RichTextBox - Font Changing

Is there a way to change the font of the selection in a RichTextBox without change the size of the selection and vice versa
Example: I have 2 words with different sizes, I select them and change the font, and the size of them not change (Like in Word and WordPad).


Answer this question

RichTextBox - Font Changing

  • Rudy W.

    This is not possible with the RichTextBox because the SelectionFont property takes an instance of the Font class which requires both a font and a size.

  • Truby

    Can you explain a bit more about what you're looking for   I don't understand what you mean by size changing for a selection when a font changes.

    Thanks
     - mike

  • Garnet

    Thank you Ralph, but is not exactly this what i'm looking for. I'm trying to change the font of the text of a RichTextBox without change the size of the selected text, and having diferent sizes in the selection: Suppose which you have two words typed in WordPad, the first word's size is 12 and the second word's size is 20. Then you select the two words and change the font to Arial, but keeping the sizes of the words. Can i do it with RichTextBox
  • Tonny Petersen

    Hi,

    did you try this:

    richTextBox1.SelectionColor = Color.Red;



  • RichTextBox - Font Changing