WM_MOUSEWHEEL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Could you, please, answer this: I have a panel control (with NO scroll
(AutoScroll = false)) on whose surface I draw a Gantt diagram; I want to
catch the WM_MOUSEWHEEL = 0X020A message but the panel refuses to catch that
message; I tried with WndProc, with override OnMouseWheel... everything - the
same result: the panel refuses to catch the event.

What should I do in order to catch that bloody event?


Thanks in advance
 
WM_MOUSEWHEEL is never sent to the Panel control. But if AutoScroll is set
to false WM_MOUSEWHEEL is sent to the parent control and you can then use
Control.GetChildAtPoint to check if the cursor was positioned above your
panel control.

HTH, Jakob.
 
public class CmBox : System.Windows.Forms.ComboBox

{

public CmBox()

{

}

protected override bool ProcessKeyEventArgs(ref System.Windows.Forms.Message
m)

{

if(m.Msg==0x100) return true;

if(m.Msg==0x101) return true;

if(m.Msg==0x102) return true;

return base.ProcessKeyEventArgs (ref m);

}

protected override void WndProc(ref System.Windows.Forms.Message m)

{

if(m.Msg==0x20a) return; //WM_MOUSEWHEEL

base.WndProc (ref m);

}

}
 
Back
Top