I have a program which has a FlowLayoutPanel inside its Form. I'm coding on the FlowLayoutPanel's MouseMove event and everything works fine; except that it doesn't fire the MouseMove event while the cursor moves on its scroll bar.
I searched the web and found the following approach which uses a derived class from FlowLayoutPanel and then overrides its WndProc method:
class FlowLayoutPanelEx : FlowLayoutPanel
{
const int WM_NCMOUSEMOVE = 0x00A0;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_NCMOUSEMOVE)
{
base.OnMouseMove(null);
}
base.WndProc(ref m);
}
}
I'm having problem with raising (or calling) the base.OnMouseMove(). It requires a MouseEventArgs object to be passed in as parameter. I need to pass the correct MouseEventArgs because my event handler relies on it, but I don't know how to set/where to get the right properties (Buttons, X, Y, etc.) to pass the correct MouseMoveEvent.
Any help will be appreciated.