Jump to content

How to know whether a form already exist before I dynamically create it ?


fredycc

Recommended Posts

Hi, I want to know the correct way in uniGUI to check if a form already exist before I dynamically create it. :huh:

 

I use the next code to create a new form:

 

procedure TMainForm.UniButton1Click(Sender: TObject);
var
 AppForm: TAppUniForm;
begin
     AppForm:= TAppUniForm.Create(uniApplication);
     AppForm.Show;
end;

 

Thanks.

 

Regards

Link to comment
Share on other sites

  • Administrators

Hi, I want to know the correct way in uniGUI to check if a form already exist before I dynamically create it. :huh:

 

I use the next code to create a new form:

 

procedure TMainForm.UniButton1Click(Sender: TObject);
var
 AppForm: TAppUniForm;
begin
     AppForm:= TAppUniForm.Create(uniApplication);
     AppForm.Show;
end;

 

Thanks.

 

Regards

 

You should keep track of Form instances in MainForm or MainModule.

Link to comment
Share on other sites

  • 6 months later...

Thanks Farshad.

 

Regards

 

Dear, I'm trying to follow the costumnre destruri created and the form of the application. In Win 32 I have it clear but not so much understand uniGui to create I do:

 

procedure TMainForm.UniButton1Click(Sender: TObject);

var

AppForm: TAppUniForm;

begin

AppForm:= TAppUniForm.Create(uniApplication); <-- Checa el Owner

AppForm.Show;

end;

 

and then destroyed.

While the subject is as if there is no instance in memory form when I call back. On win32 after closing the form reasiganaba the variable to nil to avoid variable error I have created. As with unigui resolves?

 

Thank

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...