Click to See Complete Forum and Search --> : How to killing functions in forms when unload.form?


toby
November 17th, 1999, 08:13 AM
I've got 2 severals forms loaded and a main loop form in form1. In form3 i've got i button with the function to unload the form1. But the main loop is still running

How can kill all functions running in a form when i unload it?

Best Regards

Aaron Young
November 17th, 1999, 03:09 PM
Try declaring a Form Wide Variable to Indicate When the Form is Unloading and Have your Function(s) Stop if it's set to True, eg.

private bExit as Boolean

private Sub Form_Activate()
Do
'Executing some Function Here..
DoEvents
Loop Until bExit
End Sub

private Sub Form_Unload(Cancel as Integer)
bExit = true
End Sub





Aaron Young
Analyst Programmer
adyoung@win.bright.net
aarony@redwingsoftware.com