As title, how?
I want to make a TextBlock when got focused, it background color will be window os's highlighted color (i.e The color when you highlight text in your internet explorer).
Is there any way I can get that color code so I can put into the style?
<Trigger Property="IsFocused" Value="True">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Background" Value="Blue"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
I am a little confused on what exactly you are asking for. The selected Background color or the selected Text color, and are you wanting WPF or Silverlight. This will will give you the Highlight background brush in WPF.
Look at the SystemColors Class specifically the SystemColors.HighlightBrush Property
<Setter Property="Background" Value="{x:Static SystemColors.HighlightBrush}" />
As for Silverlight take a look at this SO question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With