Vertically center text in TppMemo
Hi,
How can I center text vertically within a TppMemo?
I have scoured the newsgroups and didn't find anything on this except for
one from back in 2001 that gave an overview involving capturing the
OnDrawCommandCreate and such that was way over my head! It seems this would
be a relatively common thing to do. Is there easy way... or is there a
complicated way with some sample code? ;-)
Thanks,
Danny
How can I center text vertically within a TppMemo?
I have scoured the newsgroups and didn't find anything on this except for
one from back in 2001 that gave an overview involving capturing the
OnDrawCommandCreate and such that was way over my head! It seems this would
be a relatively common thing to do. Is there easy way... or is there a
complicated way with some sample code? ;-)
Thanks,
Danny
This discussion has been closed.
Comments
I created a new rbWiki example that shows how to do this..
www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/Vertically_Center_Memo_Text
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Wow! Thanks! I'll give that a try.
Danny
That works great on my machine but for some reason I just get little square
boxes on the print preview on any machine that not running Vista.
Any idea what could be causing that?
Thanks,
Danny
I have solved the "little square boxes" mystery. The boxes are actually the
CR/LF characters.
The solution is to replace the following from your example:
lDrawText.WrappedText.Insert(0,#13#10);
with:
lDrawText.WrappedText.Insert(0,'');
I guess it was not necessary to add CR/LF because the WrappedText.Insert
method actually adds lines and not characters.
Thanks,
Danny
Thanks for the tip. I updated the rbWiki example.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com