Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

ツールバーに項目を表示する

アプリ実行


ソースコード

App.xaml
<Application x:Class="WpfApplication2.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
</Application>
MainWindow.xaml
<Window x:Class="WpfApplication2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="800">
    <DockPanel LastChildFill="False">
        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar>
                <Button>切り取り</Button>
                <Button>コピー</Button>
                <Button>貼り付け</Button>
            </ToolBar>
            <ToolBar>
                <TextBlock VerticalAlignment="Center">検索する文字列:</TextBlock><TextBox Width="100" />
                <TextBlock VerticalAlignment="Center">置換後の文字列:</TextBlock>
                <TextBox Width="100" />
                <Button Width="40">置換</Button>
            </ToolBar>
        </ToolBarTray>
    </DockPanel>
</Window>

参考

ToolBar.OverflowMode アタッチされるプロパティ (System.Windows.Controls)
項目をメイン パネルではなくオーバーフロー パネルに配置するタイミングを示す値を取得または設定します。