Private Sub Command1_Click() Form1.Controls.Add "VB.CheckBox", "C1" With Form1!C1 .Visible = True .Move List1.Left + 50, List1.Top + 50 .BackColor = &H80000009 .ZOrder 0 .Caption = "ChecBox1" End With End Sub
'在设计时把List1的Style属性设为1 Private Sub Form_Load() With List1 .AddItem "first" .AddItem "second" .AddItem "third" End With End Sub
Form1.Controls.Add "VB.CheckBox", "C1"
With Form1!C1
.Visible = True
.Move List1.Left + 50, List1.Top + 50
.BackColor = &H80000009
.ZOrder 0
.Caption = "ChecBox1"
End With
End Sub
Private Sub Form_Load()
With List1
.AddItem "first"
.AddItem "second"
.AddItem "third"
End With
End Sub