|
-
January 28th, 2009, 02:12 PM
#1
[RESOLVED] Is the way i ending my program correct?
Hai
Code:
Private Sub close_Click()
Shell_NotifyIcon NIM_DELETE, t
Dim MyForm As Form
For Each MyForm In Forms
If MyForm.Name <> "Form5" Then
Unload MyForm
End If
Next
End
End Sub
* form5 is the startup form.
but i see still the process is running after close_Click 
?
"Don't Bring A Knife To A Gun Fight"
-
January 28th, 2009, 03:05 PM
#2
Re: Is the way i ending my program correct?
Try This:
For i = Forms.Count - 1 To 0 Step -1
Unload Forms(i)
Next
Remove the End command
-
January 28th, 2009, 03:05 PM
#3
Re: Is the way i ending my program correct?
You aren't closing Form5 properly when you call END. That's why it doesn't end without it. This is the way to fire it. It closes the last OPEN form last.
Code:
Option Explicit
Private Sub cmdExit_Click()
Dim frm As Form
For Each frm In Forms
If frm.Name <> Me.Name Then ' Unload this form LAST
Unload frm
Set frm = Nothing
End If
Next
Unload Me
End Sub
-
January 28th, 2009, 03:36 PM
#4
Re: Is the way i ending my program correct?
Thank you for both Tom and dglienna :hello:
for now ill go for dglienna's code,but toms one also alright
"Don't Bring A Knife To A Gun Fight"
-
January 28th, 2009, 03:37 PM
#5
Re: [RESOLVED] Is the way i ending my program correct?
hahaha, its funny, cant rep either of you boys
"Don't Bring A Knife To A Gun Fight"
-
January 28th, 2009, 03:42 PM
#6
Re: [RESOLVED] Is the way i ending my program correct?
It won't work if you call it from another form.
That's why I check for the last open form, then save it for the end.
-
January 28th, 2009, 03:48 PM
#7
Re: [RESOLVED] Is the way i ending my program correct?
 Originally Posted by dglienna
It won't work if you call it from another form.
That's why I check for the last open form, then save it for the end.
yah got it dglienna
"Don't Bring A Knife To A Gun Fight"
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
|