Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.84 KB

how-to-style-controls-on-a-toolbar.md

File metadata and controls

42 lines (27 loc) · 1.84 KB
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
styling controls on toolbar [WPF]
toolbars [WPF]
customizing controls on toolbar [WPF]
ba6ae056-d6a9-4c24-90f8-467ab0bc0b1a

How to: Style Controls on a ToolBar

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

Example

The following example defines styles for the controls within a xref:System.Windows.Controls.ToolBar.

[!code-xamlToolBar_snip#ToolBarAllStyles]
[!code-xamlToolBar_snip#ToolBar]

See also