Chrissy

include this line

       NewColumn.width:=-2;

in your function below to make the width size to
match the caption text.    (-1 to match the column text)

hth

-ns


----- Original Message -----
From: "Chrissy R" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 6:09 AM
Subject: [DUG]: Viev List Columns


> Hi,
>
> How do I set the columns of an View List to size automatically?
> I have tried
>
> var
>   NewColumn: TListColumn;
> begin
>   with lstSymTable do
>   begin
>     NewColumn := Columns.Add;
>     NewColumn.Caption := txtCol;
>
>     NewColumn.AutoSize := True;
>   end;
> end;
>
> The procedure does other things and the NewColumn var is declared
> at the form level but these things should not make any difference.
> This code does not change the column size.
>
> What am I doing wrong?
>
> Thanks to anyone who can help.
>
> Chrissy.
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to