Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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