TextBoxStyleKey Property

ToolBar.TextBoxStyleKey Property


Gets the Style applied to text boxes on a ToolBar.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public static ResourceKey TextBoxStyleKey { get; }

Property Value

Type: System.Windows.ResourceKey

A resource key that represents the default style for text boxes on the toolbar

Use this property to change the default style of TextBox controls on the ToolBar.

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

The following example uses this property to create a Style for TextBox controls on a 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"/>

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft