[RESOLVED] How do i shut down all proesses in my form and unload it?
My project has one form "form1" I'm using "unload me" to shut it down but there some proesses that keep run? Is "unload me" the right way to go?
Re: How do i shut down all proesses in my form and unload it?
Hello. If you mean loops, that don't end you should use boolean in insert it inside loop. For example when exit button is pushed, set this boolean to true and inside loop Do while .......(your statement) OR boolean = true. Sometimes there's a need to put it in many places, in this case breakpoints really help. If you don't have other chioce use End instead of Unload Me. This is the hard way to do it. Best regards
Re: How do i shut down all proesses in my form and unload it?
end = memory leaks <--- try to avoid it, it's like ending a process from the task manager. As djklocek says; a module level boolean is the way to go... Do until ThingyFinished Or StopAllLoopsNow (=True)
One Boolean can serve all loops, it's not hard to implement.
Re: How do i shut down all proesses in my form and unload it?
Re: How do i shut down all proesses in my form and unload it?
The boolean in the loop is a good suggestion. I usually create a separate sub in a module to end the program, ie:
vb Code:
Public Sub EndProgram
'First destroy any public objects
'Unload forms
'In each form_unload make sure they stop all loops/timers, and destroy all objects.
Dim objForm As Form
For each objForm in Forms
Unload objForm
Next
set objForm = Nothing
End Sub
Re: How do i shut down all proesses in my form and unload it?
But she is only using a single form - Form1
Re: How do i shut down all proesses in my form and unload it?
Found It , It Was A Timmer. Thank You All