Computer Science Canada

How do you close a form?

Author:  RaLz [ Fri Jun 11, 2004 4:33 pm ]
Post subject:  How do you close a form?

Any1?

Author:  Brightguy [ Fri Jun 11, 2004 4:51 pm ]
Post subject:  Re: How do you close a form?

With the Unload Statement.

Author:  RaLz [ Fri Jun 11, 2004 7:38 pm ]
Post subject: 

lol if it was that easy i woudln't have asked. I use the unload statement but the other forms are still running because i can see my public variables change.

Author:  Brightguy [ Fri Jun 11, 2004 10:58 pm ]
Post subject:  Re: How do you close a form?

Well accessing any controls on a form reloads it into memory, even if the form isn't visible. So watch out that you aren't doing that... Is that what you are asking? I'm not entirely sure. You should always make sure that all forms are unloaded when you unload the main form, or else your application will remain in memory. You can close all forms and force your application to terminate with the End statement.

Author:  RaLz [ Sat Jun 12, 2004 7:33 pm ]
Post subject: 

well i made a game right and i have two public variables for lives and health. So what you are saying is that because of these two variables the form won't unload?

Author:  Tony [ Sat Jun 12, 2004 11:38 pm ]
Post subject: 

if that is the case, what you could do is create another empty form (or module) that would hold your public variables and you would access global variables though that.
code:

someForm.variable

Author:  Brightguy [ Mon Jun 14, 2004 3:20 pm ]
Post subject:  Re: How do you close a form?

Although public variables alone shouldn't prevent a form from unloading...

So when you unload your form, it disappears, but remains in memory? That means when you close all your other forms, your project will still continue running... you'd have to manually hit the End Button to stop it.


: