samuel wells
Programmer
Hello I hope you can help me. I am a programmer, but new to VB6 my problem is as follows: I write automatic test software. I am using shapes to let me know what position a switch is in by changing the color of the shape is red or black. here is the code:
Private Sub Command1_Click()
Dim ldTime As Double
For x = 1 To 5
Call POS2
ldTime = Timer
While Timer < (ldTime + 2)
Call changecolor
Wend
Call POS1
ldTime = Timer
While Timer < (ldTime + 2)
Call changecolor2
Wend
Next
End Sub
Private Sub changecolor()
Shape1.BackColor = vbBlack ' &HFF&
End Sub
Private Sub changecolor2()
Shape1.BackColor = vbRed ' &H0&
End Sub
With this code the colors do not change, but if a add a MsgBox after each call to pos1 and pos2 the colors change.
Please help.
Private Sub Command1_Click()
Dim ldTime As Double
For x = 1 To 5
Call POS2
ldTime = Timer
While Timer < (ldTime + 2)
Call changecolor
Wend
Call POS1
ldTime = Timer
While Timer < (ldTime + 2)
Call changecolor2
Wend
Next
End Sub
Private Sub changecolor()
Shape1.BackColor = vbBlack ' &HFF&
End Sub
Private Sub changecolor2()
Shape1.BackColor = vbRed ' &H0&
End Sub
With this code the colors do not change, but if a add a MsgBox after each call to pos1 and pos2 the colors change.
Please help.