Fixed bug with scrolling mouse wheel

This commit is contained in:
Sigmanor 2017-05-13 20:01:28 +03:00
parent e3d1301414
commit 926864b03e

View file

@ -53,22 +53,22 @@ protected override void OnHandleCreated(EventArgs e)
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOUSEWHEEL)
{
int scrollLines = SystemInformation.MouseWheelScrollLines;
for (int i = 0; i < scrollLines; i++)
{
if ((int)m.WParam > 0) // when wParam is greater than 0
SendMessage(this.Handle, WM_VSCROLL, (IntPtr)0, IntPtr.Zero); // scroll up
else
SendMessage(this.Handle, WM_VSCROLL, (IntPtr)1, IntPtr.Zero); // else scroll down
}
return;
}
base.WndProc(ref m);
}
//protected override void WndProc(ref Message m)
//{
// if (m.Msg == WM_MOUSEWHEEL)
// {
// int scrollLines = SystemInformation.MouseWheelScrollLines;
// for (int i = 0; i < scrollLines; i++)
// {
// if ((int)m.WParam > 0) // when wParam is greater than 0
// SendMessage(this.Handle, WM_VSCROLL, (IntPtr)0, IntPtr.Zero); // scroll up
// else
// SendMessage(this.Handle, WM_VSCROLL, (IntPtr)1, IntPtr.Zero); // else scroll down
// }
// return;
// }
// base.WndProc(ref m);
//}
/// <summary>
/// Search and Highlight all text in RichTextBox Control