Board index » cppbuilder » Sizing font to the size of TMemo

Sizing font to the size of TMemo

Hi, I am working on a telnet client and I want the text to resize to fit
the Tmemo.
Is the fint size directly related to the font width. Note: I am using
courier to maintain
constant spacing. If it is not how can I determine how wide 80 chars
will be in font X and size Y.

Thanks
John McPeek

 

Re:Sizing font to the size of TMemo


Have a look at TCanvas::TextWidth() (and TextHeight() and TextExtent())

TMemo doesn't have a Canvas natively, but the form does, or you can assign a
TControlCanvas to the memo

Gambit

Quote
John McPeek <ee...@bellsouth.net> wrote in message

news:3A70B343.73D235F9@bellsouth.net...
Quote
> how can I determine how wide 80 chars will be in font X and size Y.

Other Threads