The Doevents thing is preventing my form from unloading.
Is there a way to unload a form nicely while a While/Doevents/Wend loop is running, or is there a better substitute altogether?
Thanks.
------------------
Printable View
The Doevents thing is preventing my form from unloading.
Is there a way to unload a form nicely while a While/Doevents/Wend loop is running, or is there a better substitute altogether?
Thanks.
------------------
Try to do it like this:
-
Public Sub Main()
Dim Active as Boolean
Active = true
While Active
'Code here
DoEvents
Wend
End Sub
-
Just call Main after starting the program and if you want to exit set Active to False.
------------------
Fox
[email protected]
http://gigotz.tsx.org
...
Every program can be reduced to one instruction which doesn't work.
[This message has been edited by Fox (edited 01-11-2000).]
I hope this will work. didnt tested yet..
Private Sub Command1_Click()
dim i as integer
while not i = 1000
i = i + 1
call unloadform()
doevents
wend
end sub
private function unloadform()
unload form
end function
Use a boolean, set to true in the form unload, and check in the loop if the bool is true, if so, exit the loop
Yes, CrazyD, that's exactly what I wrote ;)
------------------
Fox
[email protected]
http://gigotz.tsx.org
...
Every program can be reduced to one instruction which doesn't work.