Private WithEvents check1 As CheckBox
Private WithEvents txtbox As TextBox
Private WithEvents options As OptionButton
Private WithEvents labels As Label
Private Sub Command1_Click()
On Error Resume Next
Dim a(1 To 4) As String, ctl As Control
For i = 1 To 4
a(i) = Choose(i, "vb.checkbox", "vb.textbox", "vb.optionbutton", "vb.label")
Next
i = InputBox("please enter the number you want to creat" & vbCrLf & 1 & a(1) & vbCrLf & 2 & a(2) & vbCrLf & 3 & a(3) & vbCrLf & 4 & a(4), "information", 1)
Set ctl = Me.Controls.Add(a(i), Split(a(i), ".")(1), Frame1)
ctl.Move 1000, 1000, 2000, 500 ' move to your left,top,width,height
ctl.Caption = ctl.Name 'your caption
cctl.Text = ctl.Name ' your text
ctl.Visible = True
MsgBox a(i) & " 创建完毕!"
End Sub