CompuServe Thread

#Status Message Box in VB

4 messages in this thread
#2598From: James NelsonOct 11, 1991 8:12 AM
Status Box I have a form in which I use a Label with a fixed-single BorderStyle as a status msg box. What I need to be able to do for a given event is to change the contents of this label (ForeColor & Caption) and change the mouse pointer to an hourglass. I then want to pause for 2 seconds and then restore the msg box and mouse pointer back to the normal mode. What I am getting with the following code is the mouse pointer changes for the correct interval, however the Label contents are unchanged. Dim fTime As Double fTime# = Now + .00002 Do Form1.Label1.ForeColor = &HFF& Form1.Label1.Caption = "ERROR" Screen.MousePointer = 11 Loop Until (fTime# < Now) Form1.Label1.ForeColor = &HFF00& Form1.Label1.Caption = "ON-LINE" Screen.MousePointer = 0 Any help would be greatly appreciated….Thanks There are 2 Replies.
#2622From: Ted M. YoungOct 11, 1991 11:12 AM
James, Two things will probably fix things: 1. Insert an x% = DoEvents() before the Loop… line. 2. Insert a Form1.Label1.Refresh before the final Screen.MousePointer = 0 line (the last line). The DoEvents() will allow Windows (and VB) to update the Caption, and also allow Windows to do other things while you're pausing. The .Refresh will cause VB to display the new caption. – Ted There is 1 Reply.
#2698From: James NelsonOct 11, 1991 4:49 PM
Thanks, Ted…..it works fine now and it's an essential element to my application now. Looking forward to hearing from you (tips) in the future. – James
#2630From: Dennis L. HarringtonOct 11, 1991 11:35 AM
James, What happens if you move the caption and color changes to before the loop starts? –dennis