Hi All.
I have a question about creating an new instance of a form.
First ... background information.
Somewhere in a unit I have defined a from called
.
I want to instantiate the form using the variable that is automatically defined to point at that form in its unit, ie.
.
Normally to instantiate a new form I would use
Now ... here is the question.
Can I do this in a generic way for every type of form I have?
and then call this procedure like this ...
Thanks for your help.![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)
I would make my code a lot nicer if I cound do something like this.
Tim
SNL Computing
I have a question about creating an new instance of a form.
First ... background information.
Somewhere in a unit I have defined a from called
Code:
TFrmData
I want to instantiate the form using the variable that is automatically defined to point at that form in its unit, ie.
Code:
FrmData
Normally to instantiate a new form I would use
Code:
FrmData := TFrmData.Create(Self);
Now ... here is the question.
Can I do this in a generic way for every type of form I have?
Code:
procedure CreateMyForm(TheFrm: TForm);
begin
TheFrm := ???TheFrm???.Create(Self);
end;
and then call this procedure like this ...
Code:
CreateMyForm(FrmData);
Thanks for your help.
![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)
I would make my code a lot nicer if I cound do something like this.
Tim
SNL Computing