Hello
I have two different forms type TForm 1 and TForm2.
I would like to create one form object of each form type with a generic procedure
Exemple :
LoadForm (TForm1);
LoadForm (TForm2);
And the procedure :
procedure LoadForm (a_form_class : TClass);
var
o_form : TForm;
begin
o_form := TForm(a_form_class).Create (Form_Main);
end;
But this crashes ! It may be not the correct syntax ! An idea ? Another suggestion ?