Posted By

cabrel on 11/17/10


Tagged

toolbar WPF xaml c#


Versions (?)

WPF ToolBar content alignment


 / Published in: XML
 

  1. <ToolBar>
  2. <ToolBar.Resources>
  3. <Style TargetType="{x:Type ToolBarPanel}">
  4. <Setter Property="Orientation" Value="Vertical"/>
  5. </Style>
  6. </ToolBar.Resources>
  7.  
  8. <!-- This is the downside of this solution:
  9. You have to set the height at some level (once)
  10. or you will end up with controls forcing
  11. the toolbar to auto-size until it fills up it's parent -->
  12. <DockPanel Height="48">
  13. <Button Name="ButtonOne" Click=ButtonOne_Click" />
  14. <Button Name="ButtonTwo" Click=ButtonTwo_Click" />
  15. <Button Name="ButtonThree" Click="ButtonThree_Click" HorizontalAlignment="Right" />
  16. </DockPanel>
  17. </ToolBar>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: cabrel on November 17, 2010

http://blog.zerklabs.com/2010/11/wpf-toolbar-alignment/

You need to login to post a comment.