delphi: 怎样解除dbgrideh与鼠标滚轮的绑定

 我来答
wsqrock
2010-01-28 · 超过73用户采纳过TA的回答
知道小有建树答主
回答量:229
采纳率:0%
帮助的人:192万
展开全部
直接屏蔽了鼠标滚轮操作……

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, GridsEh, DBGridEh, StdCtrls, ComCtrls;

type
TForm1 = class(TForm)
DBGridEh1: TDBGridEh;
DataSource1: TDataSource;
ADOTable1: TADOTable;
RichEdit1: TRichEdit;
procedure FormCreate(Sender: TObject);

private
Procedure OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

Procedure TForm1.OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
begin
if Msg.message = WM_MouseWheel then
begin
if Msg.wParam = 0 then
begin
if DBGridEh1.Focused then SendMessage(DBGridEh1.Handle,WM_VSCROLL,SB_NONE,0);
end;
Handled:= True;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage:=OnMouseWheel;
end;

end.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式