|
-
Aug 17th, 2000, 05:06 PM
#1
Thread Starter
New Member
I just finished writing my first program... After compiling it I ran it, then I used the X on the border to close it. At first, everything seemed normal but I checked my task manager and my program was still running!!!!
Is there something I need to set in order to make it functional?
Thanx
-
Aug 17th, 2000, 05:12 PM
#2
Code:
Private Sub Form_Unload()
Dim F As Form
For Each F In Forms
Unload F
Next F
End Sub
-
Aug 17th, 2000, 05:18 PM
#3
You should set each form to nothing so it doesn't still use any resources after it has been unloaded.
Code:
Public Sub UnloadAllForms()
Dim OfTheseForms As Form
For Each OfTheseForms In Forms
Unload OfTheseForms
Set OfTheseForms = Nothing
Next OfTheseForms
End Sub
-
Aug 17th, 2000, 05:20 PM
#4
-
Aug 17th, 2000, 05:45 PM
#5
Thread Starter
New Member
In reply to Denniswrenn's reply
I don't know if I'm just stupid but when compiling it doesn't seem to like the "Private sub Form_Unload" what should I modify to adapt it to my program?
Thanx
-
Aug 17th, 2000, 06:47 PM
#6
Hehe, don't copy that Private Sub Form_Unload event. The code Dennis gave is suppose to go in that event. But his code only unloads them, doesn't set them so they don't use any resources. You should use UnloadAllForms(). And even, as Megatron suggested, put an end after it all.
Code:
Public Sub UnloadAllForms()
Dim OfTheseForms As Form
For Each OfTheseForms In Forms
Unload OfTheseForms
Set OfTheseForms = Nothing
Next OfTheseForms
End
End Sub
-
Aug 18th, 2000, 11:03 AM
#7
Thread Starter
New Member
Thanx
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
|