时钟控件循环触发按扭
check1是用来判断时钟控件的,如果打钩那么时钟控件为true反之为false而text1是来定义时钟控件的时间的,还有button控件若干个.如果定义时钟控件的时间为...
check1是用来判断时钟控件的, 如果打钩 那么 时钟控件为true 反之为false
而text1是来定义时钟控件的时间的,还有button控件若干个.
如果定义时钟控件的时间为5秒,那么例如我有4个button,5秒之后触发button1,10秒之后触发button2,15秒之后触发button3,20秒之后触发button4,25秒之后再从头开始触发button1,然后依次5秒之后触发button2,button3,button4.以此循环, 请问 这样的程序该怎么写? 急求.. 展开
而text1是来定义时钟控件的时间的,还有button控件若干个.
如果定义时钟控件的时间为5秒,那么例如我有4个button,5秒之后触发button1,10秒之后触发button2,15秒之后触发button3,20秒之后触发button4,25秒之后再从头开始触发button1,然后依次5秒之后触发button2,button3,button4.以此循环, 请问 这样的程序该怎么写? 急求.. 展开
1个回答
展开全部
Dim i As Integer
Private Sub Check1_Click()
If Check1.Value = 0 Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
Private Sub Command1_Click()
Print "1"
End Sub
Private Sub Command2_Click()
Print "2"
End Sub
Private Sub Command3_Click()
Print "3"
End Sub
Private Sub Command4_Click()
Print "4"
End Sub
Private Sub Form_Load()
Timer1.Interval = Val(Text1.Text)
End Sub
Private Sub Text1_Change()
Timer1.Interval = Val(Text1.Text)
End Sub
Private Sub Timer1_Timer()
i = i + 1
Select Case i
Case 1
Call Command1_Click
Case 2
Call Command1_Click
Case 3
Call Command3_Click
Case 4
Call Command4_Click
i = 0
End Select
End Sub
Private Sub Check1_Click()
If Check1.Value = 0 Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
Private Sub Command1_Click()
Print "1"
End Sub
Private Sub Command2_Click()
Print "2"
End Sub
Private Sub Command3_Click()
Print "3"
End Sub
Private Sub Command4_Click()
Print "4"
End Sub
Private Sub Form_Load()
Timer1.Interval = Val(Text1.Text)
End Sub
Private Sub Text1_Change()
Timer1.Interval = Val(Text1.Text)
End Sub
Private Sub Timer1_Timer()
i = i + 1
Select Case i
Case 1
Call Command1_Click
Case 2
Call Command1_Click
Case 3
Call Command3_Click
Case 4
Call Command4_Click
i = 0
End Select
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询