Today i had to manually handle the mouse wheel functionality in a customer project and suppress the raising of the MouseWheel event as long as a specific condition returned false.
After some research i found a fairly simple solution:
public const int WM_MOUSEWHEEL = 0×020A;
protected override void WndProc(ref Message m)
{ if (m.HWnd != this.Handle)
{ return;
}
switch (m.Msg)
{ case Win32Messages.WM_MOUSEWHEEL:
if( ! <your condition goes here> )
{ return;
}
break;
default:
break;
}
base.WndProc(ref m);
}
Hope this helps!