Skip to main content

Microsoft Silverlight

Answered Question Text Editor - Text bold problemRSS Feed

(0)

nz
nz

Member

Member

9 points

14 Posts

Text Editor - Text bold problem

I got a problem with set a selected word into bold form in a textbox based on silverlight 3, can any one tell me how to control it in c# code,

 

many thx

nz
nz

Member

Member

9 points

14 Posts

Re: Text Editor - Text bold problem

Maybe I didn't make this clear enough, I mean I want set a selected text into bold in a textbox

rabbott
rabbott

Member

Member

268 points

37 Posts

Answered Question

Re: Text Editor - Text bold problem

Hi nz,

You can't change the appearance of an individual word in a TextBox in Silverlight. (You can in a TextBlock by specifying Run elements as below, but of course a TextBlock isn't user-editable.)

<TextBlock>
    <Run FontWeight="Bold">This text will be bold, </Run>
    <Run Foreground="Red">and this will be red.</Run>
</TextBlock>

Silverlight doesn't have a RichTextBox like WPF does (although I believe some third-party Silverlight RichTextBox controls are available), which would be capable of doing what you're after.

Regards,
Rob

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Answered Question

Re: Text Editor - Text bold problem

Hi,

Just a thought. Why don't you think about using RichTextBox here? Check this out - http://www.codeplex.com/richtextedit

Thanks,

Pravin

"Please mark as answered, if this answers your question"

nz
nz

Member

Member

9 points

14 Posts

Re: Re: Text Editor - Text bold problem

Thank you for you help, Now I got another question, How can I get those run elements? because I try to do copy of two textblocks, I want their text be the same, and also font ....

sorry If it is not clear enough.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities