我的这个TScheduleJobForm继承自TbaseForm 而TBaseForm继承自TForm 所以好多东西都在上层写好了
我现在要对这个特定form TScheduleJobForm使其中的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;
我现在要对这个特定form TScheduleJobForm使其中的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;
TScheduleJobForm是模态窗口?
指点下吧 谢谢~~~
我的form正好只有combobox且都需要屏蔽鼠标滚轮 所以就用了postren的第一种方法
一开始就看到了这个方法 之所以不成功是因为没有在 Form 的Event里为OnMouseWheel添加FormMouseWheel 让其自动生成和大家分享下 同时谢谢各位 有时间的话我会试验下大家分享的方法~~