Backspace key on RichtextEditor
-
Hi all, i have a richtext editor where the user is allowed to enter text Now i want to trap the Vscroll event of the Rictext and here i want to execute the sendmessage and pass the backspace key in the parameter i want to delete the last "\n" character in the Richtext editor any help or pointer in this case will be appreciated Thanks and Regards Pramod
-
Hi all, i have a richtext editor where the user is allowed to enter text Now i want to trap the Vscroll event of the Rictext and here i want to execute the sendmessage and pass the backspace key in the parameter i want to delete the last "\n" character in the Richtext editor any help or pointer in this case will be appreciated Thanks and Regards Pramod
You can trap in the wndproc of the control. But you need to get the wndproc of the control, not the parent form. Try the following code to grab the event: class RichTextBoxEx : System.Windows.Forms.RichTextBox { private const int WM_VSCROLL = 0x0115; protected override void WndProc(ref System.Windows.Forms.Message m) { if (m.Msg == WM_VSCROLL) System.Diagnostics.Debug.WriteLine("vertical scroll"); base.WndProc(ref m); } }