Jump to content

Check created Application forms


Jaume

Recommended Posts

Hi,

 

is there any way to check which Application forms are created to free them? The problem is that when i check this:

 

if Form1 <> nil then

   Form1.close;

 

The Form1 is always different of nil even if it's not created and then as soon as it makes Form1.close it creates Form1 to be able to close it.

 

 

Thank you.

Link to comment
Share on other sites

  • Administrators

Hi,

 

is there any way to check which Application forms are created to free them? The problem is that when i check this:

 

if Form1 nil then

   Form1.close;

 

The Form1 is always different of nil even if it's not created and then as soon as it makes Form1.close it creates Form1 to be able to close it.

 

 

Thank you.

 

Why do you need to close a Form in code?

You must let the uniGUI manage Forms' lifetime.

Link to comment
Share on other sites


procedure TUniMainModule.GoMainMenu;
var
I:integer;
begin
// Close all forms but not the mainForm.

for I := UniSession.FormsList.Count-1 downto 0 do
begin
try
if(TUniForm(UniSession.FormsList.Items[I]).Name <> 'MainForm') then
TUniForm(UniSession.FormsList.Items[I]).Close;

finally

end;

end;

 

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.

×
×
  • Create New...