Hi, I'm having a perplexing problem with a really simple piece of code.
I have a label that, when clicked, is supposed to change the color of an oval to blue, wait half a second, and then change the color of the oval to yellow.
Here's the code:
Private Sub Label1_Click()
Shape1.FillColor = vbBlue
Sleep 500
Shape1.FillColor = vbYellow
End Sub
Of course, I have also written "Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)" under "general".
However, when I click this label, what happens is that there is a delay, and then the oval turns yellow. I never see the blue at all.
Please explain what I am doing wrong.
I have had other problems of the same sort with the "sleep" function.
I have a label that, when clicked, is supposed to change the color of an oval to blue, wait half a second, and then change the color of the oval to yellow.
Here's the code:
Private Sub Label1_Click()
Shape1.FillColor = vbBlue
Sleep 500
Shape1.FillColor = vbYellow
End Sub
Of course, I have also written "Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)" under "general".
However, when I click this label, what happens is that there is a delay, and then the oval turns yellow. I never see the blue at all.
Please explain what I am doing wrong.
I have had other problems of the same sort with the "sleep" function.