LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Dynamic Control addition and Event response

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I transform a word response to a numeric response? kanegaro Excel Discussion (Misc queries) 0 January 11th 08 05:08 PM
How do I set up a daily call out response response register? Pule Excel Worksheet Functions 1 October 7th 07 01:34 PM
Why does the click event get control? Lee Hunter Excel Programming 1 October 31st 05 06:26 PM
Addition to Worksheet Change event (RP?) Steph[_3_] Excel Programming 1 April 19th 05 05:38 PM
Control Exit event Fred Excel Programming 0 November 19th 03 12:59 AM


All times are GMT +1. The time now is 03:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"