Page view counter
HTML type styles in WPF/Silverlight
Last post 05-12-2008 11:34 AM by kashifimran. 2 replies.
Sort Posts:
05-12-2008 2:01 AM
HTML type styles in WPF/Silverlight

In html I we can put differenet tags around text to get some style for example <b>Bold Text<b> and <i>Italic Text</i>,

If I need to achieve something similiar in silverlight do I have to use two different text blocks or can we do it using one text block or something?

Thanks,

kashifimran

Loading...
Joined on 03-09-2008
Posts 46
05-12-2008 2:36 AM
Marked as Answer
Re: HTML type styles in WPF/Silverlight

You can use <Run>Foo</Run> and place hte text stying in TextBlocks.  For example:

<TextBlock>Hello <Run FontWeight="Bold">There</Run>!!!</TextBlock>

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 2 Workshop
November 19-21, 2008 - Seattle, WA
December 1-3, 2008 - Dallas, TX
http://silverlight-tour.com

swildermuth

Loading...
Joined on 10-13-2003
Atlanta, GA
Posts 1,246
05-12-2008 11:34 AM
Re: Re: HTML type styles in WPF/Silverlight

Thanks Shawn.

kashifimran

Loading...
Joined on 03-09-2008
Posts 46
Microsoft Communities