Waiting For A Form To Become Inactive

This is a good idea when, for instance, you need a Form to re-paint.

Code

Sub FormWait (frmIn As Form)
     Do While frmIn Is Screen.ActiveForm
           DoEvents
     Loop
End Sub

Usage

FormWait frmMain

 

This tip is reprinted from the VB Tips & Tricks Volume 1 book.
Parts of this tip was submitted by: Barth Riely


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.