How to assign an event handler to a control during runtime 
Author Message
 How to assign an event handler to a control during runtime


> Hi!

> Say i create a CComboBox in runtime using the Create
> method. How do I assign an OnClick event handler to that
> combobox ??

> Thanks in advance.

#define an IDC_.... that will be used as the control's ID in your
resource.h file, and use that ID when you create the control.  Add the
appropriate macros in the message map to call an event handler.  For the
macros and event handler function declaration, look at what the wizard
does and do the same things yourself.

Scott McPhillips [VC++ MVP]

Sat, 03 Jul 2004 03:10:22 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Creating a CComboBox dynamically and assigning it an event handler

2. runtime = no event/command handlers

3. Assigning handlers to DialogBar controls

4. Controls to move and dock during runtime.

5. Resize a Control during Runtime

6. ActiveX WebBrowser control creation during runtime

7. Newbie:Size of Control created during runtime

8. What control called event handler

9. ATL Composite Control - CDialog and event handlers

10. check control keys on trayicon event handler

11. Event handler using a control variable and not using message map

12. Cannot add event-handler for controls...


Powered by phpBB® Forum Software