On Thu, 29 Dec 2005 12:19:05 +0100 (CET)
[EMAIL PROTECTED] wrote:

> Hi,
> 
> I'm having problems to get the width of an autosized label in the create
> method of a form. When I put this code in;
> 
>   ShowMessage(Label1.Caption + ' : ' + IntToStr(Label1.Width));
>   Label1.Caption := 'Test1234567890';
>   ShowMessage(Label1.Caption + ' : ' + IntToStr(Label1.Width));
> 
> I get both times the same width back. I presume this is due to the not
> finished creating of the parent form. So the question would be, what is
> the way to get the width? Can it be done in the create method, or do I
> have to do it outside?

Do it outside.
For example in TLabel.OnResize.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to