Inheritance of System.Windows.Controls.ToolBar :
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ItemsControl
System.Windows.Controls.HeaderedItemsControl
System.Windows.Controls.ToolBar
![]() | Traditionally, a ToolBar holds Buttons but a WPF-ToolBar can hold any sort of WPF elements. However, the ToolBar changes the appearance and behavior of most of its elements in order to give them a common look and feel. If a ToolBar has more content than it can fit in window, it places the invisible elements in an overflow menu, which can be seen by clicking the drop-down arrow at the left (or lower) end of the ToolBar. The image shows a horizontal ToolBar of 4 Buttons, 3 CheckBoxes and a ComboBox. |
<Page xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ToolBar Width="380" Height="40">
<Button Content="Button" Height="25" Background="Green"/>
<Separator></Separator>
<Button>Open</Button>
<Button>Save</Button>
<Button>Close</Button>
<Separator></Separator>
<CheckBox FontWeight="Bold">Bold</CheckBox>
<CheckBox FontStyle="Italic">Italic</CheckBox>
<CheckBox>
<TextBlock TextDecorations="Underline">Underline</TextBlock>
</CheckBox>
<Separator></Separator>
<ComboBox Width="70" SelectedIndex="0" Background="Red">
<ComboBoxItem>100%</ComboBoxItem>
<ComboBoxItem>50%</ComboBoxItem>
<ComboBoxItem>25%</ComboBoxItem>
</ComboBox>
</ToolBar>
</Page>
When you are in the Internet Explorer run ToolBar.xaml and click its items !