tags:

views:

83

answers:

1

Hi, I am planning to keep a common event handler for 2 buttons, say ButtonA and ButtonB. When any of these buttons get clicked the same handler should be invoked. My question, is there any way to find the Button ID in the handler so that I can find out which one actually got clicked ?

Thanks

+3  A: 

If you use MFC's [ON_COMMAND_RANGE] handler macro for this, you will supply a member function for your handler that takes an ID argument. That ID corresponds to the control ID of the button being clicked in this case.

mwigdahl