|
-
Mar 17th, 2000, 08:32 PM
#1
Thread Starter
New Member
Hi!
I'm new with VB and i was wondering how to make an exit button. I could buy a book about it, but this is alot cheaper. So if anybody knows, i'd be glad to hear it from you!
Thanx!
-
Mar 17th, 2000, 08:40 PM
#2
Lively Member
Place a command button on the form with the End command in the code window.
-
Mar 17th, 2000, 08:45 PM
#3
Thread Starter
New Member
-
Mar 17th, 2000, 10:39 PM
#4
Frenzied Member
No Don't
As a rule don't use the end command ever.
I'ts all right for simple projects but using the end command stops your vb code in it's tracks, If your doing a more complicated project you will need to do certain things before you close your project, it's mainly when you start making your own class modules and usercontrolls, or start using the API that you'll have to do this but using the end command is a bad habit to get into.
Instead of end try unload form1 on your exit button. then put
msgBox "Goodbye"
in the form terminate event try ending with Unload Form1 in one command button and End in another only the first one will show your message box.
It's not absolutely vital for small projects but for more complicated projects you can actually chash your machine by using the end command (Only if you're using some bits of the API though so don't panic)
-
Mar 17th, 2000, 11:31 PM
#5
Frenzied Member
No Don't
As a rule don't use the end command ever.
I'ts all right for simple projects but using the end command stops your vb code in it's tracks, If your doing a more complicated project you will need to do certain things before you close your project, it's mainly when you start making your own class modules and usercontrolls, or start using the API that you'll have to do this but using the end command is a bad habit to get into.
Instead of end try unload form1 on your exit button. then put
msgBox "Goodbye"
in the form terminate event try ending with Unload Form1 in one command button and End in another only the first one will show your message box.
It's not absolutely vital for small projects but for more complicated projects you can actually crash your machine by using the end command (Only if you're using some bits of the API though so don't panic)
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
|