是否有类或函数来处理MFC中的mouseup或mousedown事件? [英] Is there class or function to process mouseup or mousedown event in MFC?

查看:116
本文介绍了是否有类或函数来处理MFC中的mouseup或mousedown事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我需要单独处理按钮的mouseup和mousedown事件.
我尝试使用preTranslateMessage,但是在运行dailog时,表单没有响应.我想使用从CButton派生的类来处理事件,但我不知道该怎么做.
有人知道吗?请帮助我,非常感谢.右键单击按钮并添加事件处理程序(即单击).我记不清了,但是我认为,如果您双击按钮,事件处理程序将自动为您创建...

如果要控制鼠标按钮,则可以过滤消息 ^ ],WM_RBUTTONDOWN ...

希望这会有所帮助.

祝你好运.


Now i need to process a button''s mouseup and mousedown event alone.
I has tried to use preTranslateMessage ,but when running the dailog ,the forms had no response.I want to use class derived from CButton to process the event,but i don''t know how to do it.
Does somebody konw it?Please help me,Thank you very much.

解决方案

If you want to process the click event on a button, then you should proceed on that by right click the button and adding an event handler (i.e. click). I can''t remember it properly, but I think that if you double click the button the event handler is automatically created for you...

If you want to control the mouse buttons, then you can filter the messages WM_LBUTTONDOWN[^],WM_RBUTTONDOWN...

Hope this helps.

Good luck.


这篇关于是否有类或函数来处理MFC中的mouseup或mousedown事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆