I know it is a bit strange - in fact it is so strange that it does not actually
work and that is why I was asking how to do it. I have tried all the
suggestions that have been sent so far and have come up with one
that works and that is
var
MyList1: TMyList;
begin
MyList1 := TMyList.Create(nil);
MyList1.Parent := Self;
MyList1.Visible := True;
end;
Passing "Self" to the Create method did not work but your suggestion
of using "nil" did.
Thanks to everyone for you help. Now I understand what is happening
and why it is happening.
Chrissy.
----- Original Message -----
From: Stacey Verner <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, November 29, 2000 4:02 PM
Subject: RE: [DUG]: Creating A Class
> You need to set the parent to a form, tabsheet, panel etc..
>
> e.g.
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> MyList1, Q: PMyList;
> begin
> New(Q);
> MyList1 := Q;
> MyList.Parent := Self;
> MyList1.Visible := True;
> end;
>
> On another note. The way you are createing you objects looks a little odd to
> me. I checked the help to see what you were doing and its all fine, but the
> way we would normally do it is as follows:
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> MyList1: TMyList;
> begin
> MyList1 := TMyList1.Create(nil {or whatever paremeters are requitred});
> MyList.Parent := Self;
> MyList1.Visible := True;
> end;
>
> Stacey
---------------------------------------------------------------------------
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"