Hi
I want to gray out text in the WPF text block. how do i make it?
Regards Raju
Hi
I want to gray out text in the WPF text block. how do i make it?
Regards Raju
Use TextBox instead and set IsReadOnly = true
or IsEnabled = false
On C#:
textBox.Foreground = Brushes.Gray;
On XAML:
<TextBox Foreground="Gray" />
To disable it (will change background too):
textBox.IsEnabled = false;
You can set the TextBlock.Foreground property to any color (technically, any Brush). If you want it to be grayed out, just set:
<TextBlock Text="Foo" Foreground="Gray" />
If you want it to look "disabled", you can set IsEnabled to false:
<TextBlock Text="Foo" IsEnabled="false" />