Is this possible to stylize text in Label/Button/TextBlock in WPF? I mean something like making one word Bold and another Italic? In android it looks like this https://medium.com/androiddevelopers/styling-internationalized-text-in-android-f99759fb7b8f but I can't find any equivalent in WPF
1 Answer
Yes, it is possible
<TextBlock.Inlines>
<Run FontWeight="Bold" FontSize="12" Text="I am bold" />
<Run FontStyle="Italic" Text="I am italic" />
<Run TextDecoration="Underline" Text="I am underlined" />
<Run ForeGround="Yellow" Text="I am yellow" />
</TextBlock.Inlines>
2 Comments
iknow
Okay, so another question. Is it possible to write text in resx file which ll behave like Your text? Eg. "<b> I am bold </b> <i> I am italic <\i>"
Coskun Ozogul
Yes, you can do this via binding stackoverflow.com/questions/30551372/…