RichTextBox line heights

B

Beringer

Does anybody know a way to get the heights of the various lines of text in a
RichTextBox?

I'm not sure if "height" is the proper term. But what I'm getting at is
that if you set the
font size of some selected text on a line the entire line "height" expands
to the new font
size.

I want that!

Thanks in advance,
Eric
 
L

Ludovic SOEUR

use GetPositionFromCharIndex method.

you must know the index of your carrage return. for example, if your text is
"hello\nword" :
lineHeight=myRichText.GetPositionFromCharIndex(6).Y-myRichText.GetPositionFr
omCharIndex(5).Y;

Hope it helps.
Ludovic Soeur.
 

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