Private Sub Command1_Click()
Dim objPIC As ControlFor Each objPIC In Me.Controls
If TypeName(objPIC) = "Text1" Then
MsgBox "Exist!"
Exit Sub
End If
Next objPICMsgBox "Do Not Exist !"
End Sub
Dim objPIC As ControlFor Each objPIC In Me.Controls
If TypeName(objPIC) = "Text1" Then
MsgBox "Exist!"
Exit Sub
End If
Next objPICMsgBox "Do Not Exist !"
End Sub
Dim objPIC As ControlFor Each objPIC In Me.Controls
If TypeName(objPIC) = "Text1" or TypeName(objPIC) = "com1" Then
MsgBox "Exist!"
Exit Sub
End If
Next objPICMsgBox "Do Not Exist !"
End Sub
Dim tt As ControlFor Each tt In Me.Controls
If TypeOf tt Is TextBox Then
If tt.Name = Text1 Then MsgBox "Exist!": Exit Sub
End If
If TypeOf tt Is CommandButton Then
If tt.Name = Command1 Then MsgBox "exist!": Exit Sub
End If
Next tt
MsgBox "Do Not Exist !"
End Sub
wxy_xiaoyu(然也) 的typename显示的只是text1的类型而已。