delphi中如何实现特定的一个或几个form中 使combox失去对鼠标滚轮的响应 用过如下方法 但是对整个程序中的鼠标滚轮都屏蔽了。不符合我要的效果
所以请大虾们指点 先谢过了~~~~
procedure TScheduleJobForm.FormCreate(Sender: TObject);
{
Application.OnMessage:=OnMouseWheel; }Procedure TScheduleJobForm.OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
begin
if Msg.message = WM_MouseWheel then
begin
if Msg.wParam = 0 then
begin
if cmbJob.Focused then SendMessage(cmbJob.Handle,WM_VSCROLL,SB_NONE,0);
end;
Handled:= True;
end;
end;
所以请大虾们指点 先谢过了~~~~
procedure TScheduleJobForm.FormCreate(Sender: TObject);
{
Application.OnMessage:=OnMouseWheel; }Procedure TScheduleJobForm.OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
begin
if Msg.message = WM_MouseWheel then
begin
if Msg.wParam = 0 then
begin
if cmbJob.Focused then SendMessage(cmbJob.Handle,WM_VSCROLL,SB_NONE,0);
end;
Handled:= True;
end;
end;
unit unit1interfaceuses Windows, Messages, SysUtils, Variants, Classes, StdCtrls, Graphics,
Controls,FormsType
TComboBox= class (StdCtrls.TComboBox)
procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;
End; TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}{ TComboBox}procedure TComboBox.WMMouseWheel(var Message: TWMMouseWheel);
beginend;end.
我现在要针对这几个特定form的combox取消鼠标滚轮功能 请明示如何用WM_MOUSEWHEEL判断?多谢!!
可是我的这个TScheduleJobForm继承自TbaseForm 而TBaseForm继承自TForm 所以好多东西都在上层写好了 现在要针对这几个特定form的combox取消鼠标滚轮功能
所以 想知道应该怎么做
谢谢!!