Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.02 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. wpf Treeview CheckBox Item ForeGround Color cannot Change when it is disabled?
  2. <StackPanel>
  3.     <CheckBox Name="chk" Content="check this...">
  4.         <CheckBox.Style>
  5.             <Style>
  6.                 <Setter Property="CheckBox.Foreground" Value="Red" />
  7.                 <Style.Triggers>
  8.                     <Trigger Property="CheckBox.IsEnabled" Value="True">
  9.                         <Setter Property="CheckBox.Foreground" Value="Green" />
  10.                     </Trigger>
  11.                     <Trigger Property="CheckBox.IsEnabled" Value="False">
  12.                         <Setter Property="CheckBox.Foreground" Value="Red" />
  13.                     </Trigger>
  14.                 </Style.Triggers>
  15.             </Style>
  16.         </CheckBox.Style>
  17.     </CheckBox>
  18.     <Button Content="press" Click="Button_Click"/>
  19. </StackPanel>
  20.        
  21. <Setter Property = "Foreground" Value = "Red"/>
  22.    <Style.Triggers>
  23.        <Trigger Property="IsEnabled" Value="True">
  24.              <Setter Property="Foreground" Value="Green" />
  25.        </Trigger>
  26.     </Style.Triggers>