newsanti Posted October 29, 2012 Share Posted October 29, 2012 UniGuiMainmodule create only one instance of a Formclass? Can Create more than one instance? function TjgCustomWebFormCell.CreateInnerForm: TObject; var oFormClass: TClass; begin oFormClass:=Properties['FormClass'].AsClass; Result:=UniApplication.UniMainModule.GetFormInstance(oFormClass,True); end; Quote Link to comment Share on other sites More sharing options...
newsanti Posted October 29, 2012 Author Share Posted October 29, 2012 UniGuiMainmodule create only one instance of a Formclass? Can Create more than one instance? function TjgCustomWebFormCell.CreateInnerForm: TObject; var oFormClass: TClass; begin oFormClass:=Properties['FormClass'].AsClass; Result:=UniApplication.UniMainModule.GetFormInstance(oFormClass,True); end; function TjgCustomWebFormController.CreateInnerForm: TObject; var oFormClass: TClass; begin oFormClass:=FormCell.Properties['FormClass'].AsClass; Result:=TUniFormClass(oFormClass).Create(UniApplication); //for multiple instance of uniForm end; Quote Link to comment Share on other sites More sharing options...
Ronak Posted October 29, 2012 Share Posted October 29, 2012 Create simple form or if you have created application forms then.... unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIForm; type TUniForm1 = class(TUniForm) private { Private declarations } public { Public declarations } end; // function UniForm1: TUniForm1; // Remove implementation {$R *.dfm} uses MainModule, uniGUIApplication; // function UniForm1: TUniForm1; // Remove // begin // Remove // Result := TUniForm1(UniMainModule.GetFormInstance(TUniForm1)); // Remove // end; // Remove end. Uses uniGUIApplication, procedure UniButton1Click(Sender: TObject); begin // first instance with TUniForm1.Create(UniApplication) do begin Show; end; // Second instance with TUniForm1.Create(UniApplication) do begin Show; end; end; procedure UniButton2Click(Sender: TObject); var FormA,FormB: TUniForm1; begin // first instance FormA:= TUniForm1.Create(UniApplication); FormA.Show; // Second instance FormB:= TUniForm1.Create(UniApplication); FormB.Show; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.