Click here to Skip to main content
15,891,749 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a fontDialog, button and richTextBox. when I click button, fontDialog shows. after i choose font and style,
it changes all the text. but i wanna change selected text or change from where the cursor is.
Any Idea?
Posted

if you already have text selected, then just change the SelectionFont.

If you want to change from where the cursor is to the end, then set the SelectionLength = TextLength - SelectionStart and then change the SelectionFont.
 
Share this answer
 
Take a look at the documentation for the RichTextBox on MSDN[^].

About two thirds of the way down that list you should see a link to what you want.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900