如何在功能区窗口中显示状态栏wpf c#

时间:2009-11-05 07:24:00

标签: c# wpf ribbon statusbar

我想在我自己的应用程序中使用像MS Office 2007(及更高版本)这样的功能区栏。有谁可以请我提供关于我如何做到这一点的链接或参考资料?

修改 实际上我使用的是Microsoft的功能区控件库,但无法找到添加状态栏的方法,如MS Word。

4 个答案:

答案 0 :(得分:2)

也许给this library一个机会?

编辑:实际上,显然是微软have released their own

答案 1 :(得分:1)

微软已经为WPF正式提供了功能区控件。它是免费的,它是真正的交易,来自马口的海峡。您可以阅读here,然后下载here

答案 2 :(得分:1)

 <StatusBar x:Name="StatusBar" VerticalAlignment="Bottom" Height="18" Background="AliceBlue" Initialized="StatusBar_Initialized">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="4*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>
            <StatusBarItem BorderThickness="1" Margin="0,-3,0,-2">
                <TextBlock x:Name="statusBarText">www.247moneymakingschemes.blogspot.com</TextBlock>
            </StatusBarItem>
            <StatusBarItem Grid.Column="1">
                <ProgressBar Value="30" Width="80" Height="18" />
            </StatusBarItem>
            <StatusBarItem Grid.Column="3">
                <TextBlock>Go!</TextBlock>
            </StatusBarItem>
        </StatusBar>

这将显示状态栏...但仍然不知道如何制作状态栏如MS Word 2007,如果有任何机构知道那么请帮帮我。

答案 3 :(得分:1)

我找到了以良好方式显示StatusBar的方法,

我希望它有所帮助...... ..

<DockPanel LastChildFill="True">
    <ribbon:Ribbon DockPanel.Dock="Top">
          <ribbon:RibbonTab Label="Banking">
             <ribbon:RibbonGroup>
                  <ribbon:RibbonButton Command="me:AppCommands.Cut"/>
                  <ribbon:RibbonButton Command="me:AppCommands.Copy"/>
                  <ribbon:RibbonButton Command="me:AppCommands.Paste"/>
             </ribbon:RibbonGroup>

             <ribbon:RibbonGroup>
                  <ribbon:RibbonButton Command="me:AppCommands.AddNew"/>
                  <ribbon:RibbonButton Command="me:AppCommands.Clear" />
                  <ribbon:RibbonButton Command="me:AppCommands.Delete"/>
             </ribbon:RibbonGroup>

            <ribbon:RibbonGroup>
                  <ribbon:RibbonButton Command="me:AppCommands.DownloadStatements"/>
                  <ribbon:RibbonButton Command="me:AppCommands.DownloadCreditCards"/>
                  <ribbon:RibbonButton Command="me:AppCommands.Transfer"/>
            </ribbon:RibbonGroup>
         </ribbon:RibbonTab>
    </ribbon:Ribbon>

    <StatusBar x:Name="StatusBar"
                   VerticalAlignment="Bottom"
                   DockPanel.Dock="Bottom">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="4*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>
            <StatusBarItem Margin="0,-3,0,-2" BorderThickness="1">
                <TextBlock x:Name="statusBarText">www.247moneymakingschemes.blogspot.com</TextBlock>
            </StatusBarItem>
            <StatusBarItem Grid.Column="1">
                <ProgressBar Width="80"
                             Height="18"
                             Value="30" />
            </StatusBarItem>
            <StatusBarItem Grid.Column="3">
                <TextBlock>Go!</TextBlock>
            </StatusBarItem>
        </StatusBar>

       <TextBlock DockPanel.Dock="Top" Content="Put your main content/items control here as last child in dock panel" />
</DockPanel>

干杯..