Private WithEvents acButton As AnoleCommandButton.acButton
Private Sub acButton_Click()
MsgBox "This is a dynamically added button."
End Sub
Private Sub Form_Load()
Set acButton = Controls.Add("AnoleCommandButton.acButton", "acButton")
With acButton
.Visible = True
.Width = 2000
.Caption = "Hello"
.Top = 1000
.Left = 1000
'.其他需要的属性
End With
End Sub