Option ExplicitPrivate Sub Form_Load() MsgBox IsControlInArray(Command1)
MsgBox IsControlInArray(Command2) End Sub Public Function IsControlInArray(ctl As Object) As Boolean IsControlInArray = TypeName(ctl) = "Object"End Function
谢谢各位回答 可还是有点问题我再捣鼓捣鼓yinweihong(真名:尹伟红) 的函数参数为控件名称就可以用 但是 for xContronl in Form1 IsControlInArray(xContronl) next 又不对了
返回字符串,以整数为例,如果是数组,返回"Integer()",如果不是,返回"Integer"
MsgBox IsControlInArray(Command1)
MsgBox IsControlInArray(Command2)
End Sub
Public Function IsControlInArray(ctl As Object) As Boolean IsControlInArray = TypeName(ctl) = "Object"End Function
可还是有点问题我再捣鼓捣鼓yinweihong(真名:尹伟红) 的函数参数为控件名称就可以用
但是
for xContronl in Form1
IsControlInArray(xContronl)
next
又不对了