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

Selected text in RichTextBox

1 Answer 90 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
vikas
Top achievements
Rank 1
vikas asked on 30 Jul 2014, 12:48 PM
Hi Team,
I want to get the selected text and change the font of it in rich text box. How can i achieve this.

Please advise
Thanks,

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 04 Aug 2014, 08:01 AM
Hi vikas,

RadRichTextBox exposes a set of methods that can be used in the manner editing in the control works. Basically, they operate over the selected part of the document and if there is no selection - over the paragraph where the caret is positioned. To change the font settings of the current selection you can utilize these methods, for example:
this.radRichTextBox.ChangeFontSize(20);
this.radRichTextBox.ChangeFontFamily(new FontFamily("Arial"));

I hope this helps.

Regards,
Petya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox
Asked by
vikas
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or