VSF
asked on
Form instance!
This is a easy one for you experts,
Let's say I have 3 forms on my project, they all look like the same, and their functionality to the end are quite similar.
The main difference between them is that they access diferent databases and have some different form captions.
I want to be able to create only one form at design time and then instanciate the forms as MDIChilds at runtime so that to the end user he will think that there are 3 different forms running.
I want to open different instances of the form at the same time, and want to be able to track if the especific instance is already open.
Hope you guys can help me!
Thanks,
VSF
www.victory.hpg.com.br
Let's say I have 3 forms on my project, they all look like the same, and their functionality to the end are quite similar.
The main difference between them is that they access diferent databases and have some different form captions.
I want to be able to create only one form at design time and then instanciate the forms as MDIChilds at runtime so that to the end user he will think that there are 3 different forms running.
I want to open different instances of the form at the same time, and want to be able to track if the especific instance is already open.
Hope you guys can help me!
Thanks,
VSF
www.victory.hpg.com.br
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This should do it!
Saw your email and my conclusione is that you is Brazilian, Rigth!?
See this
procedure ShowSpecific( ACaption, DatabaseDir : string );
var
Dlg : TMyDialog;
begin
Aplication.CreateForm( TMyDialog, Dlg );
try
Dlg.Database1.Directory:=D
Dlg.Caption:=ACaption;
Dlg.Table1.Open();
Dlg.ShowModal(); //Replace to show and see *
finally
Dlg.Free(); //To modal form only
end;
end;
* To a MDI Form erase the Dlg.Free and assign a Action:=caFree into the onClose event.
T++, Radler;
Feliz Páscoa.