title | description | ms.date | helpviewer_keywords | ms.assetid | |||
---|---|---|---|---|---|---|---|
How to: Style Controls on a ToolBar |
Learn how to specify the style of the controls in a ToolBar in a Windows Presentation Foundation (WPF) application. |
03/30/2017 |
|
ba6ae056-d6a9-4c24-90f8-467ab0bc0b1a |
The xref:System.Windows.Controls.ToolBar defines xref:System.Windows.ResourceKey objects to specify the style of controls within the xref:System.Windows.Controls.ToolBar. To style a control in a xref:System.Windows.Controls.ToolBar, set the x:key
attribute of the style to a xref:System.Windows.ResourceKey defined in xref:System.Windows.Controls.ToolBar.
The xref:System.Windows.Controls.ToolBar defines the following xref:System.Windows.ResourceKey objects:
-
xref:System.Windows.Controls.ToolBar.ButtonStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.CheckBoxStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.ComboBoxStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.MenuStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.RadioButtonStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.SeparatorStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.TextBoxStyleKey%2A
-
xref:System.Windows.Controls.ToolBar.ToggleButtonStyleKey%2A
The following example defines styles for the controls within a xref:System.Windows.Controls.ToolBar.
[!code-xamlToolBar_snip#ToolBarAllStyles]
[!code-xamlToolBar_snip#ToolBar]