cancel
Showing results for 
Search instead for 
Did you mean: 

VB programmin / forms

SOLVED
Go to solution
Fred Martin_1
Valued Contributor

VB programmin / forms

I've been given some MS Visual Basic code for a sinple program which uses only one form. It displays some information on the screen briefly, then the program ends.

However, whenever the program ends, there is always a single process left behind.

I've been told it's probably because the form was not properly closed.

Can someone give me the syntax for this command to close the form just before the program ends?
fmartin@applicatorssales.com
8 REPLIES
Fred Martin_1
Valued Contributor

Re: VB programmin / forms

Ahhh, mmm.

close formname

Is that it?
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: VB programmin / forms

unload formname

?
fmartin@applicatorssales.com
Ganesh Babu
Honored Contributor

Re: VB programmin / forms

if u use "END" command in your program it should close all the forms and should remove the form also..

what is the process that is left behind??

Ganesh

Ganesh Babu
Honored Contributor
Solution

Re: VB programmin / forms

for unloading your form u can use this ..

http://www.vb-helper.com/howto_unload_form.html

Ganesh
Fred Martin_1
Valued Contributor

Re: VB programmin / forms

Thanks Ganesh, the link you provided is very good. The process that's left behind is just the name of the form, I forget what it is exactly (don't have the code in front of me).

Also regarding use of the 'end' statement as mentioned above, I read someplace that 'end' can be dangerous as it ends things too abruptly, not cleaning up memory etc. on the way out. Not sure if that's true.
fmartin@applicatorssales.com
Ganesh Babu
Honored Contributor

Re: VB programmin / forms

yes end will not clean up the memory proper.. since u told as a simple program and new to VB.. most of them use END.. i thought u also used the same..

for info about end statement check this out..

http://www.mvps.org/vbvision/visual_basic_tips.htm

Ganesh
Rahul_19
Advisor

Re: VB programmin / forms

Fred,

Since vb Form is a object, some times just unloading it is not enough ,

after unloading it Use following command

Set
= Nothing , it will remove the it form the memory

Well you can browse site
http://www.vb-faq.com


Regards
Rahul

Be as radical as reality.
Antoniov.
Honored Contributor

Re: VB programmin / forms

use
Unload Me
at end of Activate event (if your form has not any button or control) or else at end of eventi Click in QuitButton.

Antonio Vigliotti
Antonio Maria Vigliotti