Giving the users a progress update
Have you ever wanted/needed to post a progress update to your users during program
execution (say, during a complicated calculation) that would not halt the program?
Typically, such updates can be displayed with the Msgbox control. But, that control
requires the user to interact by pressing Ok (and, more importantly, it halts program
execution until the user interacts). A simple solution is to put a command button
(called Command1 in this example) on your form...size it large enough to hold the update
messages...and center it on the form. Then, set it's visible property to false in
the Form_Load procedure (to be sure it'll be set properly each time the program is run).
Private Sub Form_Load()
Command1.Visible=False
'More code goes here!
End Sub
When you're ready to display a program update, set the command button's caption
property to the message to be displayed. Then set the button's visible property to True.
To ensure the button displays, invoke the button's Refresh property: Command1.Caption="Message
to be displayed to User"
Command1.Visible=True
Command1.Refresh
Once visible, you can change the button's caption as needed. When you no longer need to
provide updates to the user, simply hide the button again: Command1.Visible=False
|