Reputation: 109
What is the equivalent of e.Handled = true in the KeyDown event handler for the MouseDown event handler? I wish none the mouse events to have any effect on the RichTextBox (disable completely the interaction of the mouse with the RichTextBox). More precisely, I wish to prevent the user from marking the text present in the RichTextBox or positioning the cursor anywhere else than the end of the text in the RichTextBox by means of the mouse.
Upvotes: 3
Views: 824
Reputation: 175766
One way would be to kill off any selection before it begins:
rtb.SelectionChanged += (sender, e) => { rtb.SelectionStart = rtb.TextLength; };
Upvotes: 2