Hi
I have a problem with Timer1-2 running at the same time.
Timer1 should run first, at the end Timer1, Timer2 should run.
Sometimes Timer1 does not run. Direct jumps Timer2
I have two days doing tests and I can not see what's wrong.
In VB6 this works well..
Put 2 timer, 1 label, 1 buttom
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
Dim i As Integer , g As Integer
Public Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval=400
'MsgBox "See Problem" '*<=== Uncomment to see how it work.
Timer2.Enabled = True
Timer2.Interval=500
Label1.ForeColor = vbRed
End Sub
Public Sub Timer1_Timer()
i=i+1
If i >= 10 Then
Timer1.Enabled=False
End If
Label1.Caption = "Change Test Leads : " + i
'Label1.Refresh
'DoEvents
End Sub
Public Sub Timer2_Timer()
g=g+1
If g >= 10 Then
Timer2.Enabled=False
End If
Label1.Caption = "Wait a Moment : " + g
'Label1.Refresh
'DoEvents
End Sub
|
I hope someone can help.
Thanks in advance.