|
-
Mar 25th, 2003, 02:25 PM
#1
Thread Starter
New Member
Capturing runtime created control events
I'm adding controls at runtime but need to be able to capture their events. For example.
Set mycmd = Controls("Frame" & (x)).Add("Forms.CheckBox.1")
How do i capture the click event from this newly formed check box.
i tried to name it and write code based on thAt name but i't doesn't work
ie
mycmd.name = "newcheck"&x
Private Sub newcheck1_Click()
Call whatever
End Sub
this won't work.
Anyone have any idea on how to do this, even an idea of were i could find how to do this?
Thanks
-Ted
-
Mar 25th, 2003, 03:07 PM
#2
I susspect you're missing the withevents keyword for this.
Try taking a look at Tom's post here :http://www.vbforums.com/showthread.p...hreadid=235463
-
Mar 25th, 2003, 03:32 PM
#3
Thread Starter
New Member
WOW I've been programming Excel since 97 and I consider myself to be a good programer and never did figure this one out. I tried the withevents before but for one reason or another it never worked. Guess I gave up to soon. Thanks!!!!!!!!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|