How to close a form totally in codes ? I was using "form.hide" all the time which I don't think it is appropriate.
Printable View
How to close a form totally in codes ? I was using "form.hide" all the time which I don't think it is appropriate.
Whether you have 1 or form or 40 forms this is the best way to make there they all are unloaded.
Code:
Public Sub EndProg()
dim f as Form
For Each f in Forms
f.Hide
Unload f
Next f
End Sub
I did this before, but the memory still not really release after the "For Each f in Forms" routine. Even I add the Set f = Nothing also not mush help in the memory release issue that I encounter. (I monitor the memory usage through the Task Manager.)
How does we recover all the used memory when a form is unload.
I've heard from a few places that VB has some memory management issues so I'm not sure if that is a possibility.Code:Public Sub EndProg()
dim f as Form
For Each f in Forms
f.Hide
Unload f
Next f
End ' Try Adding This also
End Sub
Hi! YoungBuck, noop... What I mean is I have a MDI Form, when I unload a child form (Main program still running) it did not really release the memory.
Chris,
The MDI Child form is associated in memory with the parent form and will leave a footprint. This memory is not released until the parent form is closed.
The way MDI is handled in VB really sucks.
Cheers,
P.
I also want a job at the Fortis Bank and become a hyperactive member using the companies Internet connection :):):)
Waar zit die bank?