'在窗体上加一个CommandButton和一个Frame Private Sub Command1_Click() Dim l As VB.Label Set l = Controls.Add("VB.Label", "Label1", Frame1) With l .Left = 100 .Top = 200 .Height = 300 .Width = 1000 .Caption = "ss" .Visible = True End With End Sub
如果换为PIC框,并且PIC拥有一个INDEX值
Private Sub Command1_Click() Dim l As VB.Label Set l = Controls.Add("VB.Label", "Label1", Picture1(1)) '~~~~~~~~~~~~改这不完了吗? With l .Left = 100 .Top = 200 .Height = 300 .Width = 1000 .Caption = "ss" .Visible = True End With End Sub
Private Sub Command1_Click()
Dim l As VB.Label
Set l = Controls.Add("VB.Label", "Label1", Frame1)
With l
.Left = 100
.Top = 200
.Height = 300
.Width = 1000
.Caption = "ss"
.Visible = True
End With
End Sub
Dim l As VB.Label
Set l = Controls.Add("VB.Label", "Label1", Picture1(1))
'~~~~~~~~~~~~改这不完了吗?
With l
.Left = 100
.Top = 200
.Height = 300
.Width = 1000
.Caption = "ss"
.Visible = True
End With
End Sub