Hello!
I have a number of MDI forms that I want created via a global formcreate proc. Whats the best way to do this?
Currently I'm doing this:
procedure m_CreateForm(var frm:TForm;sfrm:string);
begin
Application.CreateForm(TFormClass(FindClass(sfrm)),frm);
end;
To execute I call:
m_CreateForm(TForm(frmChild),'TfrmChild');
As you can see its pretty ugly. I'm also using 'FindClass' which means i have to call 'RegisterClass' in the initialization of every MDI form. Yuck!
Does anyone have an alternative solution?
thanks
Ryan
I have a number of MDI forms that I want created via a global formcreate proc. Whats the best way to do this?
Currently I'm doing this:
procedure m_CreateForm(var frm:TForm;sfrm:string);
begin
Application.CreateForm(TFormClass(FindClass(sfrm)),frm);
end;
To execute I call:
m_CreateForm(TForm(frmChild),'TfrmChild');
As you can see its pretty ugly. I'm also using 'FindClass' which means i have to call 'RegisterClass' in the initialization of every MDI form. Yuck!
Does anyone have an alternative solution?
thanks
Ryan