Font in RichTextBox

  • Thread starter Thread starter Franz
  • Start date Start date
F

Franz

When the form is loaded, I set the Text property of the RichTextBox. The font of the text is fine until I add a new line. The font
of the new line is different from that of the original text. The font of the new text is a little bit larger. I have set the
SelectionFont property to be equal to the Font of the RichTextBox. I don't know why this happens.
 
Hi Franz,

You say that the font of the new line is different from the original.
Does this mean that you're initialising the font when there's text already
present? If so, is this text selected ? Because if it is, the font change
will be for the selected text - not for subsequent text.

I'd recommend setting the font when the RTBox is empty (clean solution),
or selecting all the text, changing the font and then deselecting (messy
solution).

Regards,
Fergus
 
Back
Top