Calculate needed size for a TLabel

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-27T13:06:33Z Indexed on 2010/04/27 13:13 UTC
Read the original article Hit count: 113

Filed under:

Ok, here's the problem. I have a label component in a panel. The label is aligned as alClient and has wordwrap enabled. The text can vary from one line to several lines. I would like to re-size the height of the the panel (and the label) to fit all the text.

How do I get the necessary height of a label when I know the text and the width of the panel?

© Stack Overflow or respective owner

Related posts about delphi