在窗体上画一个Label控件,它的Index属性值设为0,名字为:lblArray
Private Sub Form_Load()
lblArray(0).Caption = "11111"
Load lblArray(1)
lblArray(1).visible=true
lblArray(1).Caption = "dddd"
End Sub
Private Sub Command1_Click()
If newlabel Is Nothing Then
Set newlabel = Controls.Add("vb.label", "lblnew", Me)
newlabel.Move Form1.Left + 500, 500
newlabel.Caption = "New Lable"
newlabel.Visible = True
Else
MsgBox "New Lable"
End If
End Sub