Share via


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

資源索引鍵,表示工具列上文字方塊的預設樣式。

範例

下列範例會使用這個屬性,在 上建立 Style 控制項 TextBoxToolBar

<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>

備註

使用這個屬性來變更 上 ToolBar 控制項的預設樣式 TextBox

XAML Attribute Usage

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

適用於