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