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