Return to Snippet

Revision: 36073
at November 17, 2010 16:30 by cabrel


Initial Code
<ToolBar>
    <ToolBar.Resources>
        <Style TargetType="{x:Type ToolBarPanel}">
            <Setter Property="Orientation" Value="Vertical"/>
        </Style>
    </ToolBar.Resources>

    <!-- This is the downside of this solution:
            You have to set the height at some level (once)
            or you will end up with controls forcing
            the toolbar to auto-size until it fills up it's parent -->
    <DockPanel Height="48">
        <Button Name="ButtonOne" Click=ButtonOne_Click" />
        <Button Name="ButtonTwo" Click=ButtonTwo_Click" />
        <Button Name="ButtonThree" Click="ButtonThree_Click" HorizontalAlignment="Right" />
    </DockPanel>
</ToolBar>

Initial URL


Initial Description


Initial Title
WPF ToolBar content alignment

Initial Tags
c#

Initial Language
XML