Skip to main content
Home Forums Silverlight Programming Visual Studio & Silverlight Development Tools Using Resource File
5 replies. Latest Post by varshavmane on November 3, 2009.
(0)
Sailaja ...
Member
7 points
13 Posts
11-03-2009 1:25 AM |
Hi ,
am having a resource file in which i amplacing the resource key and resource value.
In resource value i need to place a plain text, so to place the text in a new line am uing \n inbetween the plain text. Its working fine for me.
If I want to change the some plain text to bold, then how should I place the text there. I need to have the same thing for font size too..
For som text I want to have the fontsize =9, and for the some text in the same plain text, need fontsie=11.
How to handle this.
Please help me out in this.
Regards,
Sailaja.
Pravinku...
Contributor
4300 points
708 Posts
11-03-2009 3:52 AM |
Hi,
Check the below artical which has code like-
<TextBlock> <Run FontWeight="Bold">Hello There.</Run> <Run Foreground="Red">How are you?</Run> <Run FontStyle="Italic">I am fine thanks!</Run> <Run>漢字</Run> </TextBlock>
http://blogs.silverlight.net/blogs/msnow/archive/2008/09/24/silverlight-tip-of-the-day-45-text-formatting-with-the-textblock-control.aspx
Or eitherwise design a user control which gives a capability of RichTextBox for Silverlight -
http://www.vectorlight.net/controls/rich_textbox.aspx
Thanks,
Pravin
"Please mark as answered, if this answers your question"
bharathk...
280 points
51 Posts
11-03-2009 3:56 AM |
hai sailaja.
plz try this.it will work
varshavmane
6739 points
1,583 Posts
11-03-2009 3:57 AM |
Check this:
http://msdn.microsoft.com/en-us/library/system.windows.documents.run(VS.95).aspx
Hope that helps.
Hi Pravin,
Am also using th eTextblosks only.
But the data to display in the textbox is getting derived from Resource value from resource file using C# code.
Am able to retrieve the data too.. But am not able to format that derived data. While placing th edata in resource file only we need to format the data. I need to know that formatting concept.
11-03-2009 5:03 AM |
try this:
tb.TextAlignment =
tb.Inlines.Add(