Using the Refresh method of the object you want redrawing is a better
solution in most cases, because if you use DoEvents, the user can click on
other controls on your form and kick off other VB code during the DoEvents.
In most cases, it is desirable that the user does not start other processing
while the original process is running; it depends on the use.
-----Original Message-----
From: Ramil G. Sagum [mailto:bb_gene@y...]
Sent: 19 March 2002 10:58
To: professional vb
Subject: [pro_vb] RE: Updating a Label Within a Loop
Aaron
Cardyin was right, use DoEvents (i use it too.) Also, I haven't verified
this yet, but you can use object.Refresh to force a repaint of a control or
form.
-----Original Message-----
From: Aaron M. Soto [mailto:soto@d...]
Sent: Monday, March 18, 2002 8:02 AM
To: professional vb
Subject: [pro_vb] Updating a Label Within a Loop
Hello list...
I have a fairly intensive process that runs in a While loop and I want to
update a Label on my form at every iteration of the loop. However, when I
try to update the label (lblMyLabel.Caption = "My Status") nothing visually
changes on my form.
Is there some sort of repainting of the form I need to control or is it not
possible to easily update a Label within a loop like that?
Please let me know, thanks...
-Aaron
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com