WPF TextBlock Underline

user679530 picture user679530 · Apr 9, 2011 · Viewed 62.2k times · Source

I have a textblock of width say 500, but my string is just say "H" but I want to underline the whole textblock width not just under H what can I do?

Answer

Talia H picture Talia H · Feb 22, 2012

You should use the property "TextDecorations" of the TextBlock. Like that:

 <TextBlock Text="H" TextDecorations="Underline"/>