
August 22nd, 2007, 12:55 PM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 3
Time spent in forums: 34 m 33 sec
Reputation Power: 0
|
|
|
Try a little experimentation
Quote: | Originally Posted by dgcarter How would one align text in the center of a rich edit box?
Not left to right, but centered from top to bottom... so bacically in the middle of the box. |
Your TRichEdit has a height (in pixels). Call it RH. Its font has a measure of height also; there are two -- use the one that includes the leading. Call it FH. If your text is L lines, it;s height is
FH*L. You want (RH - FH*L) div 2 blank lines before your text.
This should help if you know in advance the number of lines
you will enter. If you want to text to continue centering vertically as you enter them--I have to think this one over! HF
|