Board index » delphi » Tmemo and TRichedit Window Size

Tmemo and TRichedit Window Size

Is there a way to determine the size of a memo or richedit in rows/columns?

If the user resizes either, I really need to know how many rows and columns
the resized component has.

Help!?

Thanks,

Roy.

r...@flightlab.liv.ac.uk

 

Re:Tmemo and TRichedit Window Size


The number of columns is only relevant if you use a fixed pitch font. The
number of rows is only relevant if you always use the same font.
You can calculate the number of rows/columns by dividing the
ClientWidth/ClientHeight by the character height/width. You can get the
character height/wdth with the GetTextMetric API function.

Quote
"Roy Coates" <r...@camaro.org.uk> wrote in message

news:9liuqh$p9g$1@news.liv.ac.uk...
Quote
> Is there a way to determine the size of a memo or richedit in
rows/columns?

> If the user resizes either, I really need to know how many rows and
columns
> the resized component has.

> Help!?

> Thanks,

> Roy.

> r...@flightlab.liv.ac.uk

Other Threads