mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed bug with scrolling mouse wheel
This commit is contained in:
parent
e3d1301414
commit
926864b03e
1 changed files with 16 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue