K
Ken Soenen
I dynamically added a CommandButton using the ADD method as shown below. Now
the problem is: How do I define?,create?,handle? the click event that is
generated by that control. I have tried putting in event handlers named:
Private Sub CommandButton1_Click()
Private Sub Zbut_Click()
Private Sub ZButton_Click()
and none work.
Thanks,
ken
Dim ZButton As Control
Set ZButton = Controls.Add("Forms.CommandButton.1", "ZBut")
With ZButton
.left = 17
.top = 30
.Width = 12
.Height = 12
.BackColor = &H8000000F
.ForeColor = &H80000012
.Caption = "Z"
.FontSize = 10
.Font.Bold = True
End With
the problem is: How do I define?,create?,handle? the click event that is
generated by that control. I have tried putting in event handlers named:
Private Sub CommandButton1_Click()
Private Sub Zbut_Click()
Private Sub ZButton_Click()
and none work.
Thanks,
ken
Dim ZButton As Control
Set ZButton = Controls.Add("Forms.CommandButton.1", "ZBut")
With ZButton
.left = 17
.top = 30
.Width = 12
.Height = 12
.BackColor = &H8000000F
.ForeColor = &H80000012
.Caption = "Z"
.FontSize = 10
.Font.Bold = True
End With