Private Sub Form_Load()
Set playyy = Controls.Add("VB.CommandButton", "playyy", Me)
With playyy
.Visible = True
.Top = 100 + 500
.Left = 3000
.Caption = "Test"
End With
End Sub
Private Sub playyy_Click()
MsgBox "haha"
End Sub
点击生成的按纽没反应,哪错了?
已自己解决,前面定义的时候加上 withEvents
Dim WithEvents playyy As CommandButton