How To Center Vertically
Posted: Wed Jul 05, 2006 11:57 pm
The application which I am upgrading with TRichView had the ability to center text both horizontally and vertically.
I achieved the vertical centering by loading the text into an invisible TMemo and using TMemo's Lines.Count property to count the lines. I then calculated the number of lines possible in the resizeable window and inserted 1/2 this number of blank lines in front of the text before displaying it in the actual TMemo.
I tried using the obsolete TRV.Lines property, but it doesn't seem to actually return the number of lines - more like the number of items?
Do you have any suggestion on how to achieve vertical centering for a TRichViewEdit (read only)?
Thanks!
I achieved the vertical centering by loading the text into an invisible TMemo and using TMemo's Lines.Count property to count the lines. I then calculated the number of lines possible in the resizeable window and inserted 1/2 this number of blank lines in front of the text before displaying it in the actual TMemo.
I tried using the obsolete TRV.Lines property, but it doesn't seem to actually return the number of lines - more like the number of items?
Do you have any suggestion on how to achieve vertical centering for a TRichViewEdit (read only)?
Thanks!