> Hi,
>
> I am trying to create, at run time, a number of instances of a TTreeView.
I have
> created a class of this type and I will add some methods to this.  I can
create this
> in one unit and, when I press a button on my form, things seem to work but
I
> cannot get this new object to display.  The code that I have for the
button click is
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
>   MyList1, Q: PMyList;
> begin
>   New(Q);
>   MyList1 := Q;
>   MyList1.Visible := True;
> end;

Replace with...
begin
  MyList1 := PMyList.Create(Self);
  MyList1.Parent := Self;
  MyList1.Visible := True;
  MyList1.Left := .... etc
end;

... or similar.

New is for allocating memory for pointing to records etc. You should use the
Create constructor method for creating objects.

David
DB Solutions Ltd.

---------------------------------------------------------------------------
    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