This commit is contained in:
Sigmanor 2017-05-31 22:10:09 +03:00
parent 269afc798f
commit 0ff70fe612
2 changed files with 25 additions and 18 deletions

View file

@ -53,22 +53,29 @@ 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++)
{
try
{
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); // scroll down
}
catch (OverflowException)
{
SendMessage(this.Handle, WM_VSCROLL, (IntPtr)1, IntPtr.Zero); // scroll down
}
}
return;
}
base.WndProc(ref m);
}
/// <summary>
/// Search and Highlight all text in RichTextBox Control

View file

@ -795,9 +795,9 @@ public void InitializeComponent()
this.customRTB.ContextMenuStrip = this.contextMenuStrip1;
this.customRTB.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.customRTB.ForeColor = System.Drawing.SystemColors.WindowText;
this.customRTB.Location = new System.Drawing.Point(6, 52);
this.customRTB.Location = new System.Drawing.Point(6, 47);
this.customRTB.Name = "customRTB";
this.customRTB.Size = new System.Drawing.Size(523, 247);
this.customRTB.Size = new System.Drawing.Size(529, 252);
this.customRTB.TabIndex = 10;
this.customRTB.Text = "";
this.customRTB.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.customRTB_LinkClicked);