ToolBar.ButtonStyleKey 属性

定义

Style获取应用于工具栏上的按钮。

public:
 static property System::Windows::ResourceKey ^ ButtonStyleKey { System::Windows::ResourceKey ^ get(); };
public static System.Windows.ResourceKey ButtonStyleKey { get; }
static member ButtonStyleKey : System.Windows.ResourceKey
Public Shared ReadOnly Property ButtonStyleKey As ResourceKey

属性值

一个资源键,表示工具栏上按钮的默认样式。

示例

以下示例演示如何使用此属性将控件 Style 应用于 Button 控件 ToolBar

<Style x:Key="{x:Static ToolBar.ButtonStyleKey}" TargetType="Button">
  <Setter Property="Foreground" Value="Blue"/>
  <Setter Property="FontSize" Value="14"/>
  <Setter Property="HorizontalAlignment" Value="Center"/>
  <Setter Property="VerticalAlignment" Value="Center"/>
</Style>

注解

使用此属性可更改控件的默认Button样式ToolBar

XAML 属性用法

< object属性=“{ToolBar.ButtonStyleKey}"/>

适用于