Jump to content

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


fredycc
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...