Click here to Skip to main content
15,898,988 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to capture the OnPressed event for a Button control in a dialog box. I am aware of the fact that we have an OnClick event but how do I manipulate this to handle an OnPressed event?
This question may have been answered before but I could not find an answer to it myself. If so, could you please redirect me to that answer?
Posted
Comments
[no name] 30-Jul-13 11:50am    
What "OnPressed" event are you talking about?
Mobile.Instinct 30-Jul-13 11:52am    
We we keep a button control pressed, I need to capture that and handle that event.

1 solution

There is something like OnPressed event, it calls: MouseDown event.

CWnd::OnLButtonDown[^]
CWnd::OnMButtonDown[^]
CWnd::OnRButtonDown[^]
 
Share this answer
 
v2
Comments
Mobile.Instinct 31-Jul-13 4:44am    
But this is not an MFC C++ function that I could use. Or will I be able to use this? Could you suggest me an example to follow this? I know we can do this in C# but not sure about C++.
Maciej Los 31-Jul-13 4:58am    
Sorry, my mistake. See my answer now.
CPallini 31-Jul-13 5:23am    
5.
Maciej Los 31-Jul-13 5:40am    
Thank you, Carlo ;)
Mobile.Instinct 31-Jul-13 5:48am    
Yes, that is fine but could you suggest how do I use this with my Button Control? Or how do I detect whether one of my buttons is pressed or not and then allow the OnLButtonDown to function?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900