![]() |
|
#1
|
|||
|
|||
|
I designed a button at runtime, but I do nothing when clicked. The sub Object_Click() doesn't work.
Example. Dim padd as Control Private ToggleButton1_Click() Set padd = Controls.Add("Forms.CommandButton.1", "CommandButton3", Visible) padd.Left = 10 padd.Top = 285 padd.Width = 35 padd.Height = 24 padd.Caption = "Add" End Sub Here every thing is fine The click sub should be as follow or I'm wrong. Private Sub padd_Click() msgbox "this click is OK" End Sub Thanks for your time and attention. Michael Cervantes |
|
#3
|
|||
|
|||
|
Nope. It didn't work.
Message: Run-Time Error 459 Object or class does support the set of events. Thanks. |
|
#4
|
|||
|
|||
|
Ok. I make it works with your help of course.
Dim WithEvents padd as CommandButton Thanks a lot. Best regards |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Runtime error | click101 | Calendar Wizard | 11 | 24-05-2012 13:21 |
| runtime error 445 with CorelScriptTools.GetFolder() | rsinnig | Corel Photo-Paint VBA | 1 | 16-10-2003 05:07 |