rt
我想在用for语句一个一个控件的比较。觉得很麻烦。
Dim ctl As Control
Dim strArr As String()
Dim i As Integer
For i = 0 To UBound(strArr, 1) - 1
For Each ctl In Me.Controls
If TypeOf (ctl) Is TextBox Then
If ctl.Name = strArr(i) Then
MsgBox(ctl.Text)
Exit For
End If
End If
Next
Next
倒不是很麻烦,只是如果控件太多的话会比较慢