怎么点一下Command控件,就循环一次,Text控件的内容?
str1 = "123 "
str2 = "321 "
Text1.Text = str1
怎么点一下Command控件,就循环一次,Text控件的内容?
现在只能循环str1里面的内容!不能循环str2
谢谢了
[解决办法]
使用数组变量:
Option Explicit
Dim str(3) As String
Dim i As Integer
Private Sub Command1_Click()
i = i + 1
Text1 = str(i - 1)
If i > = 4 Then
i = i - 4
End If
End Sub
Private Sub Form_Load()
str(0) = "Hello! "
str(1) = "A "
str(2) = "B "
str(3) = "C "
End Sub