Skip to main content

Microsoft Silverlight

Answered Question HTML type styles in WPF/SilverlightRSS Feed

(0)

kashifimran
kashifimran

Member

Member

74 points

46 Posts

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,

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Answered Question

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 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

kashifimran
kashifimran

Member

Member

74 points

46 Posts

Re: Re: HTML type styles in WPF/Silverlight

Thanks Shawn.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities