|
-
Sep 14th, 2000, 09:02 AM
#1
Hi,
If I click on "x" on the top right corner of the form to close the vb application, the program exits, but it stays in my memory, i.e. it does not unload itself.
If I exit by creating my own control, then no problem as I can put "unload" code underneath. But how can I do it for "X"? Please advise what to do so that the application does not stay in memory if the user closes the application by closing the window.
Sandra
-
Sep 14th, 2000, 09:12 AM
#2
transcendental analytic
In Form_Unload event you can clean your mess. but all objects loaded in the form will automatically unload.
If you have doevents in your code, be careful to avoid that code to be running while your form is closing, it will hang up. To avoid, check for forms.count in loops with doevents.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 14th, 2000, 09:13 AM
#3
Frenzied Member
Normally clicking the X button will unload the form, do you use Subclassing in the prog? Then I think it's the best to put
Code:
Private Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Unload Me
End
End Sub
but only if there's no other way... What do you mean with:
If I exit by creating my own control, then no problem as I can put "unload" code underneath. But how can I do it for "X"? Please advise what to do so that the application does not stay in memory if the user closes the application by closing the window.
Can't you use the "unload" code in the Form_QueryUnload Sub?
Oh Kedaman, if you read this... please run ICQ I want to speek to ya mate!
[Edited by Jop on 09-14-2000 at 10:16 AM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 14th, 2000, 09:20 AM
#4
Set the form to Nothing in the Unload event.
Code:
Private Sub Form_Unload(Cancel As Integer)
'ÿou can't use the Me keyword when you set the form to nothing
Set Form1 = Nothing 'or wathever your form name is
End Sub
-
Sep 15th, 2000, 07:39 AM
#5
transcendental analytic
I'm so sorry Jop (and anyone else who missed me) but i have icq on my comp back home and i haven't got my connection yet, so i once ran icq and then noticed i lost all the offline mess you wrote, and from that moment i decided to run icq as soon as i get my new connection (should be next week (they said))
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|