Delphi 拦截滚轮事件不响应滚轮的上下滚动
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;
type TForm1 = class(TForm)
Panel1: TPanel; ComboBox1: TComboBox; Label1: TLabel; procedure FormCreate(Sender: TObject); private { Private declarations }
Procedure OnMouseWheel(Var Msg: TMsg; var Handled: Boolean);
public { Public declarations }
end;
var Form1: TForm1;
implementation {$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := OnMouseWheel;
end;
procedure TForm1.OnMouseWheel(var Msg: TMsg; var Handled: Boolean);
begin
if Msg.message = WM_MOUSEWHEEL then
if (ActiveControl IS TComboBox) or (ActiveControl IS TStringGrid) then//TComboBox和 TStringGrid不响应滚轮
Handled := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Application.OnMessage := nil;
end;
end.
Delphi 拦截滚轮事件不响应滚轮的上下滚动的更多相关文章
- opencv与mfc显示图片操作,MFC的鼠标响应在opencv图片上失效,opencv滚轮事件没有响应问题描述解决。
原文作者:aircraft 原文链接:https://www.cnblogs.com/DOMLX/p/11588758.html 用mfc 与OPENCV编写成. 出了很多冲突异常事件导致鼠标操作没有 ...
- Qt事件系统之二:鼠标事件和滚轮事件
在Qt中,事件作为一个对象,继承自 QEvent 类,常见的有键盘事件 QKeyEvent.鼠标事件 QMouseEvent 和定时器事件 QTimerEvent 等,与 QEvent 类的继承关系图 ...
- js 页面无滚动条添加滚轮事件
当页面无滚动条时,滑动滚轮时window.onscroll事件不会相应,此时应该去添加滚轮事件 var MouseWheelHandler=function(e){ e.preventDefault( ...
- VC 鼠标滚轮事件控制绘图的问题
问题描述: 在MFC中绘制数据曲线,通过鼠标滚轮来进行放大缩小操作.在使用滚轮事件时,发现如果数据量较大,会出现卡顿. 解决方案: 鼠标滚轮事件会进行重复绘图,考虑在鼠标滚轮结束之后再重绘: 在鼠标滚 ...
- js鼠标滚轮事件
不多说,直接上代码. //非ie document.body.onmousewheel = function(event) { event = event || window.event; conso ...
- javascript 学习之自定义滚动条加滚轮事件
要自己写一个自定义滚动条加上滚轮事件,之前的没有滚轮事件不完整,今天整理了一个. 1.滚轮事件是不兼容的,firefox中是必需要用事件绑定的添加,用的DOMMouseScroll,当滚动鼠标的时候, ...
- 第二十七课:滚轮事件,mouseenter与mouseleave事件的修复
滚轮事件 jQuery核心库没有对mousewheel事件的差异性进行处理,但作为一个常用的事件,本文讲解一下. mousewheel事件只有火狐浏览器不支持.mousewheel用于取得滚动距离的属 ...
- mousewheel滚轮事件 浏览器的写法
鼠标的滚轮事件,在Jquery中有对应的一个插件:https://github.com/brandonaaron/jquery-mousewheel 原生的滚轮事件:火狐与其他浏览器使用了不同的事件 ...
- mousewheel滚轮事件
原生的滚轮事件:火狐与其他浏览器使用了不同的事件 /* * 滚轮事件只有firefox比较特殊,使用DOMMouseScroll; 其他浏览器使用mousewheel; * */ // firefox ...
随机推荐
- linux 设置git记住密码
linux下: 1.在~/下, touch创建文件 .git-credentials, 用vim编辑此文件,输入: https://{username}:{password}@github.com 注 ...
- JDBC URL格式定制
数据库URL制定: 当加载的驱动程序,可以建立程序中使用DriverManager.getConnection()方法的连接.为方便参考,让列出了三个重载DriverManager.getConnec ...
- leetcode-surrounded regions-ZZ
Problem Statement (link): Given a 2D board containing 'X' and 'O', capture all regions surrounded by ...
- X11/Xlib.h:没有该文件或目录
编译程序时出现的错误,在安装日志上发现一句:x11/xlib.h nosuch file or directory 在网上查阅了资料,原来是x11M没有装. 解决方案:先安装X11,命令为 su ...
- MongoDB安装步骤
安装C:\Users\Administrator>d:\mongo\bin\mongod -dbpath=D:\ND.Monodb\ND.Monodb.db -logpath=D:\ND.Mon ...
- 使用Powershell 管理 Windows 2012 hyper-v复制
HyperV复制相关命令 Suspend-VMReplication Suspends replication of a virtual machine. 暂停复制虚拟机. Resume-VMRepl ...
- C#中的多线程 - 高级多线程 z
原文:http://www.albahari.com/threading/part4.aspx 专题:C#中的多线程 1非阻塞同步Permalink 之前,我们描述了即使是很简单的赋值或更新一个字段也 ...
- msvcr100.dll问题描述及修复方式
出现问题的大部分原因是因该文件被木马病毒破坏导致系统找不到此文件,出现错误提示框,想要解决此问题只需找到专业的DLL文件下载网站,下载该文件,复制到相应目录.即可解决.msvcr100.dll为Vis ...
- WAS缓存问题
在项目中经常遇见这样的问题:修改应用的配置文件web.xml后,无论重启应用还是重启WebSphere服务器,都不能重新加载web.xml,导致修改的内容无效. 这个问题困扰了我好久,即使删除了${w ...
- Type Systems
This section deals with more theoretical aspects of types. A type system is a set of rules used by a ...