Re: Easy way to have CButton handle its own ON_BN_CLICKED

Tech-Archive recommends: Speed Up your PC by fixing your registry




in your button class use the following message map:

ON_CONTROL_REFLECT(BN_CLICKED, OnHandler)

for even more power see ON_CONTROL_REFLECT_EX()

hth
bhu


James B. wrote:
I'm trying to develop some generic controls for our App.

I want to subclass off of CButton, and then have this class handle it's own
ON_BN_CLICKED. I looked into mesesage reflection but that didnt' seem quite
right. I just want my new button class to handle button clicks not the parent
window.

I guess I could just handle the Left button down in my new button class and
assume this is a button click but figured there might be a more
straightforward way to have my class based on CButton get the ON_BN_CLICKED
or equiv.

Thanks much

James

.


Quantcast