Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

Focused Trigger

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="" Height="100" Width="300">     <Window.Resources>         <Style TargetType="{x:Type TextBox}">             <Style.Triggers>                 <Trigger Property="IsMouseOver" Value="True">                     <Setter Property="Background" Value="Orange" />                 </Trigger>                 <Trigger Property="IsFocused" Value="True" >                     <Setter Property="Background" Value="Orange" />                 </Trigger>             </Style.Triggers>         </Style>     </Window.Resources>     <Grid>         <TextBox Height="20" Width="200">             this is a test         </TextBox>     </Grid> </Window>