vb循环选择输出

来源:百度知道 编辑:UC知道 时间:2024/05/22 10:34:09
相关源码
cd 是全局变量.. 其他地方没有任何调用
===================================这里是获得cd长度 以及 输出内容
Private Sub Command1_Click()
cd = 0
If Not IsNumeric(Text5.Text) Then
Label5 = "请在喊话间隔内输入整数且大于0"
Else
If Text5.Text > 0 Then
Timer1.Interval = Text5.Text * 1000
If Text1.Text = "" Then
Else
cd = cd + 1
End If

If Text2.Text = "" Then
Else
cd = cd + 1
End If

If Text3.Text = "" Then
Else
cd = cd + 1
End If

If Text4.Text = "" Then
Else
cd = cd + 1
End If
Label5 = cd & "条喊话内容已记录,请确保在喊话条数不足4条时是从上往下记录,否则将出现不可挽回的错误! < 注意检查空格, 如果一个记录只有一个空格也会喊话 > """
Else
Label5 = "请在喊话间隔内输入整数且大于0"
End If
End If
End Sub
==========================================下面是要输出的源码段
Private S

代码改下吧
从Private Sub Timer1_timer() 开始

Private Sub Timer1_timer()
Static tim
Dim str As String
If tim = 1 Then str = Text1.Text
If tim = 2 Then str = Text2.Text
If tim = 3 Then str = Text3.Text
If tim = 4 Then str = Text4.Text
SendKeys "{enter}"
SendKeys str
SendKeys "{enter}"
tim = tim + 1
If tim > 4 Then tim = 1
End Sub

改好了 一次说一句