以下代码是判断在已有的控件数组Label1()中能否加载Label1(3)。你自己修改一下即可:
Dim mylabel As Label, isload As Boolean
For Each mylabel In Label1
If mylabel.Index = 3 Then
isload = True
Exit For
End If
Next
If isload Then
MsgBox "Label1(3)已存在,不能再Load"
Else
MsgBox "Label1(3)不存在,可以Load"
End If
for each 控件变量 in 控件数组
if 控件变量.index= 控件索引 then msgbox "控件已存在!"
next
先判断一下他的Visible是否是True