|
-
Jul 1st, 2008, 05:35 PM
#1
Thread Starter
New Member
Exit command code
Hi I'm very new to this software (version 6.0) and when constructing small .exe's I find that when I exit the program that the program is still running when I open task manager. I have figured out why- the code I use to switch between forms eg.
Private Sub cmdnext_Click()
Form1.Hide
Form2.Show
End Sub
OR
Private Sub cmdnext_Click()
Unload Form1
Load Form2
End Sub
The problem is my exit commands only exit the current form so when I exit, the 'hidden' form(s) are still running. Is there anyway of exiting the whole application instead of typing-
Unload Form1
Unload Form2
Unload Form3
etc....
-for my exit command code.
Open to any suggestions thanks.
-
Jul 1st, 2008, 05:41 PM
#2
Re: Exit command code
Welcome to VBForums 
You can use a fairly simple loop to do it, as shown (along with other things you may not know) in the article How should I close my form/program/class? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)
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
|