ToolBar.TextBoxStyleKey 属性

定义

Style获取应用于文本框的 ToolBar

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

属性值

一个资源键,表示工具栏上文本框的默认样式。

示例

以下示例使用此属性为控件创建StyleTextBox一个 ToolBar

<Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="TextBox">
  <Setter Property="Background" Value="DarkBlue"/>
  <Setter Property="Foreground" Value="White"/>
  <Setter Property="FontSize" Value="14"/>
  <Setter Property="FontStyle" Value="Italic"/>
  <Setter Property="HorizontalAlignment" Value="Center"/>
  <Setter Property="VerticalAlignment" Value="Center"/>
  <Setter Property="Width" Value="75"/>
</Style>

注解

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

XAML 属性用法

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

适用于