CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Finland,Vaasa
    Posts
    7

    How to killing functions in forms when unload.form?

    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


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: How to killing functions in forms when unload.form?

    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
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured