Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Quit VB when through

Status
Not open for further replies.

budbeth

Programmer
Oct 29, 2002
31
US
I'm feeling kind of stupid here -
checked 4 or 5 books, Web searched, Vb Help and still can't figure this out!

What code do I need after my Unload frm to close the project and Visual Basic both??

TIA
 
If you are talking about closing the IDE then as far as I know you cannot code a program to close itself as well as the IDE unless the program is an Addin.


Rob
 
All I had to do was step outside on a cigarette break and explain the situation to a co-worker. Ever notice that when you explain a problem to someone else, that's when you figure out the solution?
Duh - all I had to do was turn it into an .exe......
 
Assuming you're talking about your app compiled to an exe.
You need to destroy all instances of your forms.
But to make sure you don't leave stuff still referenced.
Otherwise an object may still be referenced even after quitting.

So a simple example could be;
place an Exit button on appropriate form.
Code behind the form logic could be for example;
unload form3
unload form2
if any object set then
set object3=nothing
set object2=nothing
set object1=nothing
unload form1

 
It uses only one form and I do unload and set it to nothing.
It's a combination of those two lines of code and compiling it into an .exe that helped me acheive what I was trying to do. Thanx for the reminder....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top