如何在C ++中禁用组合框的鼠标滚轮? [英] How do I disable the mouse wheel for a combo box in C++ ?

查看:130
本文介绍了如何在C ++中禁用组合框的鼠标滚轮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

我正在尝试在C ++(MFC)中为组合框禁用鼠标滚轮。任何人都可以帮助我吗?



我尝试了什么:



我尝试使用WM_MOUSEWHEEL,但没达到标记。

Hi All...
I am trying to disable mouse wheel for a combo box in C++(MFC).Can anyone help me?

What I have tried:

I tried using WM_MOUSEWHEEL but not upto the mark.

推荐答案

一种常见的方法是从MFC控件派生自己的类并使用 PreTranslateMessage 处理消息(未经测试):

A common method would be deriving your own class from the MFC control and handling the message there using PreTranslateMessage (untested):
BOOL CMyComboBox::PreTranslateMessage(MSG* pMsg)
{
    return pMsg->message == WM_MOUSEWHEEL ? TRUE : CComboBox::PreTranslateMessage(pMsg);
}


这篇关于如何在C ++中禁用组合框的鼠标滚轮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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