Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
This example shows how to use Trigger elements to style a ComboBoxItem.
This example creates a Style that changes the appearance of a ComboBoxItem in response to an event that is raised on the item. When you move the mouse over the ComboBoxItem the appearance of the control changes.
Example
<Style x:Key="Triggers" TargetType="{x:Type ComboBoxItem}">
<Style.Triggers>
<Trigger Property="ComboBoxItem.IsMouseOver" Value="true">
<Setter Property = "Foreground" Value="Red"/>
<Setter Property = "FontSize" Value="20"/>
<Setter Property = "FontFamily" Value="Arial Bold"/>
</Trigger>
</Style.Triggers>
</Style>
For the complete sample, see Combo Box Styles Sample