Font in RichTextBox

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.
 
F

Fergus Cooney

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top