Combobox中禁止鼠标中键滚动list列表
//第1种方法
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
if ActiveControl = ComboBox1 then
Handled := True;
end;
//第2种方法(了解该方法后,以后会有助于我们处理更复杂的问题)
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm)
cbb1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
FOldWndProc: TWndMethod;
public
{ Public declarations }
procedure NewWndProc(var Message: TMessage);
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.NewWndProc(var Message: TMessage);
begin
if ((Message.Msg <> WM_MOUSEWHEEL) ) then
FOldWndProc(Message);
end; procedure TForm1.FormCreate(Sender: TObject);
begin
FOldWndProc := cbb1.WindowProc;
cbb1.WindowProc := NewWndProc; end; procedure TForm1.FormDestroy(Sender: TObject);
begin
cbb1.WindowProc := FOldWndProc;
end;
Combobox中禁止鼠标中键滚动list列表的更多相关文章
- 移动端vue页面禁止移动/滚动
当需要在移动端中禁止页面滚动,加入:@touchmove.prevent即可,例子如下 <template> <div @touchmove.prevent> <h3 c ...
- JGUI源码:Accordion鼠标中键滚动和手机端滑动实现(2)
本文是抽屉组件在PC端滚动鼠标中键.手机端滑动时,滚动数据列表实现方法,没有使用iscroll等第三方插件,支持火狐,谷歌,IE8+等浏览器. 演示在:www.jgui.com Github地址:ht ...
- android 32 Gallery:横着滚动的列表
Gallery:横着滚动的列表 mainActivity.java package com.sxt.day05_01; import java.util.ArrayList; import java. ...
- JGUI源码:鼠标中键滚动再次优化(5)
//电脑端中键滚动事件 var mousewheel = getBrowserInfo() == "Firefox" ? "DOMMouseScroll" : ...
- iOS 开发中类似上下滚动弹幕实现原理
#mark ---滚动弹幕 列表中留有7条记录 大于7条时删除并指引表视图向上滑动 - (void)addRowActionWithContent:(NSString *)str { if (sel ...
- 关于WPF的ComboBox中Items太多而导致加载过慢的问题
原文:关于WPF的ComboBox中Items太多而导致加载过慢的问题 [WFP疑难]关于WPF的ComboBox中Items太多而导致加载过慢的问题 ...
- WijmoJS 中自定义 React 菜单和列表项模板
WijmoJS 中自定义 React 菜单和列表项模板 在V2019.0 Update2 的全新版本中,React 框架下 WijmoJS 的前端UI组件功能再度增强. WijmoJS的菜单和类似列表 ...
- 原生js禁止页面滚动
// 开启.禁止页面滚动 bodyScroll: { e(e) { e.preventDefault();// 注意此处代码片段必须这样提出来已保证传入下边两个事件的处理程序一样才生效,分别写到事件处 ...
- 如何在pyqt中实现平滑滚动的QScrollArea
平滑滚动的视觉效果 Qt 自带的 QScrollArea 滚动时只能在两个像素节点之间跳变,看起来很突兀.刚开始试着用 QPropertyAnimation 来实现平滑滚动,但是效果不太理想.所以直接 ...
随机推荐
- [转]Ubuntu安装Python3.6
Ubuntu安装Python3.6 Ubuntu默认安装了Python2.7和3.5 输入命令python
- 终极C语言指针
// ex1.cpp : Defines the entry point for the console application. // #include "stdafx.h" # ...
- mac os x lipo 工具
lipo是管理Fat文件的工具,可以查看平台列表,提取.重新打包 dreamdeMac-mini:test dream$ lipo -info libtest001.a Architectures i ...
- pprof进行golang程序性能分析
一.导入包 import _ "net/http/pprof" 二.启动监控routine go func() { http.ListenAndServe("0.0.0. ...
- Python之路PythonNet,第二篇,网络2
pythonnet 网络2 问题: 什么是七层模型tcp 和udp区别三次握手和四次挥手************************************************** tcp ...
- Pytorch中的Batch Normalization操作
之前一直和小伙伴探讨batch normalization层的实现机理,作用在这里不谈,知乎上有一篇paper在讲这个,链接 这里只探究其具体运算过程,我们假设在网络中间经过某些卷积操作之后的输出的f ...
- Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that the ...
- day20kafka
Storm上游数据源之Kakfa PS:什么是kafka,为什么要学习它? http://blog.csdn.net/zcf_0923/article/details/70859535http://b ...
- linux日志管理
//有关当前登录用户的信息记录在文件utmp中 //登录进入和退出纪录在文件wtmp中 [root@bogon python]# who //who命令查询utmp文件并报告当前登录的每个用户 /va ...
- Next generation configuration mgmt
转自:https://purpleidea.com/blog/2016/01/18/next-generation-configuration-mgmt/ It’s no secret to the ...