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

属性值

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

示例

以下示例演示如何使用此属性将 应用于 StyleButton 上的 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>

注解

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

XAML 属性用法

<objectproperty=“{ToolBar.ButtonStyleKey}"/>

适用于