This is a migrated thread and some comments may be shown as answers.

Making text bold

1 Answer 56 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Olga
Top achievements
Rank 1
Olga asked on 07 Apr 2011, 10:07 PM
Hello,

I can't seem to figure out how the MSWordExample in the richtextbox demo works. I want to understand how when a user types something in the document, then selects and makes bold, it becomes bold. It seems that all you do is specify a command in the xaml to which the B is bound to: ToggleBoldCommand, however where is that command defined? I did something very similar, but it does not seem to work.

Thanks,
Olga

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 11 Apr 2011, 09:39 AM
Hi Olga,

The "magic" happens in the RadRichTextBoxRibbonUI.RichTextCommand attached property. You can read more about it in this blogpost (a little outdated, but the main idea remains), this help page, and this forum thread (describing how to create your custom UI for the commands RadRichTextBox exposes).
Essentially most of the commands exposes event that is raised whenever state changes (e.g. the selection is over bold text); you can subscribe to this event and update the state of the control in the event handler.

Don't hesitate to contact us if you have other questions.

Regards,
Boby
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Olga
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or