Is it possible to choose a form (as a mainform) from a list of \"available\" forms after connecting to the database ? I have a datamodule with 3 \'available\' forms.No mainform
The main form is deemed to be the first form created by a call to Application.CreateForm. So add your selection logic to the .dpr file code, and then call Application.CreateForm to create whichever form the user selects.
// .dpr code
begin
Application.Initialize;
CreateMainForm;
Application.Run;
end.
Here, CreateMainForm is provided by you and implements the user form selection. It might go like this:
procedure CreateMainForm;
var
Form: TForm;
FormClass: TFormClass;
begin
FormClass := ChooseMainFormClass;
Application.CreateForm(FormClass, Form);
end;
Again, ChooseMainFormClass is provided by you.