Discussion:
Handle click event in a button
(too old to reply)
Marc Lefebvre
2007-07-18 21:02:52 UTC
Permalink
with Visual C++ 6.0


I want to handle click event in my CMyButton class.

when I click a button in my application I want to log the text of the button
in a log file.


It's the job of the CMyButton class, I dont want to handle the click in the
view.


how the CMyButton can handle the click event.


Thank's
Marc
Tom Serface
2007-07-19 05:51:57 UTC
Permalink
Typically the click is handled by the view or dialog that owns the control,
but you could use ON_CONTROL_REFLECT or one of the variants to get the
message in the control code:

http://msdn2.microsoft.com/en-us/library/yef4xasc(VS.80).aspx

This isn't what you are looking for exactly, but the example may help you do
what you want with your control:

http://www.codeproject.com/buttonctrl/NdtURLLinkButton.asp?df=100

Tom
Post by Marc Lefebvre
with Visual C++ 6.0
I want to handle click event in my CMyButton class.
when I click a button in my application I want to log the text of the
button in a log file.
It's the job of the CMyButton class, I dont want to handle the click in
the view.
how the CMyButton can handle the click event.
Thank's
Marc
Continue reading on narkive:
Loading...