ToolBar.TextBoxStyleKey 属性

定义

Style 应用于 ToolBar 上的文本框。

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

属性值

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>

注解

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

XAML 属性用法

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

适用于