如何使功能区控件快速访问工具栏位于GUI的顶部?



因此,我需要快速访问工具栏出现在Windows应用程序之类的顶部,例如
词和前景。

编辑:这是我在这里得到其他人的反馈后的最新代码:

<r:RibbonWindow
    x:Class="Company.RouteVisualization.MainWindowView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:r="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
    Title="Route Visualization"
    Height="395"
    Width="832"
    TextOptions.TextFormattingMode="Display"
    WindowStyle="None">
    <Grid>
        <r:Ribbon Grid.Row="0" Name="ribbon">
            <r:Ribbon.QuickAccessToolBar>
                <r:RibbonQuickAccessToolBar>
                    <StackPanel Orientation="Horizontal">
                        <r:RibbonButton Label="B1" VerticalAlignment="Center"/>
                        <r:RibbonButton Label="B2" VerticalAlignment="Center"/>
                    </StackPanel>
                </r:RibbonQuickAccessToolBar>
            </r:Ribbon.QuickAccessToolBar>
            <r:RibbonTab Header="Home">
                <r:RibbonGroup Name="groupHome" Header="View">
                    <r:RibbonToggleButton Name="DisplayMapButton" Label="Display Map" IsChecked="True"
                    LargeImageSource="../Resources/Images/Earth.png"
                    RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                    <r:RibbonToggleButton Name="OnlineButton" Label="Online"
                    LargeImageSource="../Resources/Images/Online.png"
                    RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                </r:RibbonGroup>
            </r:RibbonTab>
        </r:Ribbon>
    </Grid>
</r:RibbonWindow>

最佳答案

使用RibbonWindow,您可以检查以下链接:

http://blogs.msdn.com/b/wpf/archive/2010/08/04/why-should-i-use-a-ribbonwindow.aspx

另请阅读:

http://www.shujaat.net/2012/10/ribbon-quick-access-toolbar.html

关于c# - 如何使功能区控件快速访问工具栏位于GUI的顶部?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18867860/

10-10 21:36