|
-
Jun 30th, 2006, 01:50 PM
#1
Thread Starter
Addicted Member
App stays in processes once closed
How is it when I close out of my application that it stays running in my processes?
-
Jun 30th, 2006, 01:59 PM
#2
Addicted Member
Re: App stays in processes once closed
Does your app Dim F as form and then F.Show?
When the main app closes, this DIMmed form does not close automatically - it is up to you to close it manually and then set it to nothing.
An easy way of doing this is to place this in the Form_Unload event of the main form of the program:
VB Code:
Dim x As Long
'---------------------------------------------------------------------
On Error Resume Next
'---------------------------------------------------------------------
For x = Forms.Count - 1 To 0 Step -1
If Not Forms(x) Is Me Then
Unload Forms(x)
Set Forms(x) = Nothing
End If
Next
On Error GoTo 0
-
Jun 30th, 2006, 02:08 PM
#3
Thread Starter
Addicted Member
Re: App stays in processes once closed
If a user X's out, would that work then too?
-
Jun 30th, 2006, 02:11 PM
#4
Addicted Member
Re: App stays in processes once closed
Yep - anything that causes the main form to UNLOAD will cause that code to execute. Of course, I am ASSUMING that the "orphaned" form is the cause of your problem, and I may be wrong...
-
Jun 30th, 2006, 03:55 PM
#5
PowerPoster
Re: App stays in processes once closed
in form unload ..
VB Code:
Do Until Forms.Count = 1
Unload Forms(Forms.Count - 1)
Loop
Or ..
Dim Form
For Each Form In Forms
Unload (Form)
Next Form
in form terminate..
make sure you stop any timers also ..and close any other objects that maybe open ..
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
|