Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For...Next Problem

Status
Not open for further replies.

TheCrappyProgrammer

Programmer
Sep 17, 2001
41
US
I am trying to increment a value in a text box gradually by using a For...Next loop and a Sleep() function. However, it only increments it in one step at the end of the loop. How would I make it increment gradually?

For x = 0 to 10
lblscore.Caption = Str(Val(lblscore.Caption) + 50)
Sleep(500)
Next x
 
Hi.

Add a Refresh command after you update the caption. (see below).

For x = 0 to 10
lblscore.Caption = Str(Val(lblscore.Caption) + 50)
lblscore.Refresh
Sleep(500)
Next x

Stu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top