I have a unit which defines a frame (FrameCom) and then in another form I declare two private variables:
I have a unit which defines a frame (FrameCom) and then in another form I declare two private variables:
private
fFrame1,
fFrame2: TFrameCom;
In the Create event of the form I initialise the first frame:
fFrame1:=TFrameCom.Create(self);
fFrame1.Parent:=self;
All good here.
Then I add the code for the second frame:
fFrame2:=TFrameCom.Create(self);
fFrame2.Parent:=self;
and I get a runtime AV complaining that "A component named FrameCom already exists"
Can I not have more than one frames in the form?
private
fFrame1,
fFrame2: TFrameCom;
In the Create event of the form I initialise the first frame:
fFrame1:=TFrameCom.Create(self);
fFrame1.Parent:=self;
All good here.
Then I add the code for the second frame:
fFrame2:=TFrameCom.Create(self);
fFrame2.Parent:=self;
and I get a runtime AV complaining that "A component named FrameCom already exists"
Can I not have more than one frames in the form?
fFrame2:=TFrameCom.Create(self);
ReplyDeletefFrame2.Name:='SecondFrame';
fFrame2.Parent:=self;
Alexander Sviridenkov Is this because I create them on run-time?
ReplyDeleteJohn KouraklisYes, at design-time name is changed automatically
ReplyDelete