Option Explicit
Dim WithEvents cmdOK As CommandButton
Private Sub Form_Load()
Set cmdOK = Controls.Add("VB.CommandButton", "cmdOK", Me)
With cmdOK
.Left = 100
.Top = 100
.Width = 2000
.Height = 1000
.Caption = "确定"
.Visible = True
End With
End Sub
Private Sub cmdOK_Click()
MsgBox "您单击了确定!"
End Sub