Skip to main content

Microsoft Silverlight

Answered Question Using Resource FileRSS Feed

(0)

Sailaja Reddy
Sailaja ...

Member

Member

7 points

13 Posts

Using Resource File

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.

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: Using Resource File

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"

bharathkumars87
bharathk...

Member

Member

280 points

51 Posts

Re: Using Resource File

hai sailaja.

plz try this.it will work


http://blogs.silverlight.net/blogs/msnow/archive/2008/09/24/silverlight-tip-of-the-day-45-text-formatting-with-the-textblock-control.aspx

bharath kumar.s
Please "Mark as Answer" if this post answered your question. :)

varshavmane
varshavmane

Contributor

Contributor

6743 points

1,585 Posts

Re: Re: Using Resource File

Hi,

Check this:

http://msdn.microsoft.com/en-us/library/system.windows.documents.run(VS.95).aspx

Hope that helps.

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

Sailaja Reddy
Sailaja ...

Member

Member

7 points

13 Posts

Re: Using Resource File

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.

 

Regards,

Sailaja.

 

varshavmane
varshavmane

Contributor

Contributor

6743 points

1,585 Posts

Answered Question

Re: Re: Using Resource File

Hi,

try this:

tb.Width = (double)400;

tb.TextAlignment = TextAlignment.Center;

tb.Inlines.Add(new Run() { Text = "This is ", FontSize = 12 });

tb.Inlines.Add(new Run() { Text = " text.", FontSize = 22 });

Hope that helps.

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities