c# - Is there a way to underline one character in a WPF TextBlock? -


is there way apply underline text decoration 1 character in textblock (or amount less full block)?

i have text want output "this worf misspelt" , have f in worf underlined.

i know can do:

textblock47.textdecorations = textdecorations.underline; 

but don't want entire block underlined.

failing that, there control can use other textblock gives capability? i've looked rich text seems awful lot of work what's simple effect. if is way, how go generating text of specific format (10pt, courier new, 1 character underlined) in c# code?

you can use underline in textblock:

<textblock name="textblock47">   wor<underline>f</underline> misspelt </textblock> 

or

textblock47.inlines.add(new run("this wor")); textblock47.inlines.add(new underline(new run("f"))); textblock47.inlines.add(new run(" misspelt")); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -