Woops - put editcheck mode into gear before posting!
Yes - what I meant was:
...
MyForm1 := TMyForm.create(self);
MyForm2 := TMyForm.create(self); // This is OK
MyFrame1 := TMyFrame.create(self);
MyFrame2 := TMyFrame.create(self); // This fails with "Component MyFrame
already exists
...
And yes - this does appear only to occur when creating 2 instances of a
TFrame within a single form.
I'm trying to create a persistant set of TFrames in a Page Control.
The good news is that you are exactly right in suggesting that assigning a
unique name property solves the problem. Thanks for the pointer, Carl.
Cheers
Stephen
-----Original Message-----
From: Carl Reynolds [mailto:[EMAIL PROTECTED]]
Sent: Monday, 5 February 2001 3:20 p.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Using Frames
From: Stephen Bertram [mailto:[EMAIL PROTECTED]]
> procedure SetUp;
> begin
> MyForm1 := TMyForm;
> MyForm2 := TMyForm; // This is OK
> MyFrame1 := TMyFrame;
> MyFrame2 := TMyFrame; // This fails with "Component MyFrame
> already exists".
Presumably you meant "TMyForm.Create(...)" and "TMyFrame.Create(...)". The
problem seems to be a conflict in the name, so try assigning a new name to
your first frame instance before creating your second, ie.
MyFrame1 := TMyFrame.Create(...);
MyFrame1.Name := 'MyFrame1';
MyFrame2 := TMyFrame.Create(...);
MyFrame2.Name := 'MyFrame2';
I'd further hazard a guess that this only happens when both frames are
created on the same form.
Cheers,
Carl
---------------------------------------------------------------------------
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"