Disable RichTextBox mouse wheel

This is a discussion on Disable RichTextBox mouse wheel within the C# Programming forums, part of the General Programming Boards category; When a RichTextBox has focus, it will naturally scroll vertically when the mouse wheel is turned. Is it possible to ...

Disable RichTextBox mouse wheel

When a RichTextBox has focus, it will naturally scroll vertically when the mouse wheel is turned. Is it possible to disable this feature? I was hoping for a Suppress option in the MouseWheel event arguments but no joy. Any ideas?

Create your own class that derives from RichTextBox and try one of two things:

Override OnMouseWheel() and do not call base.OnMouseWheel(). Unfortunately, I don't think any processing actually happens in the OnMouseWheel() method aside from firing events, so this probably won't solve your problem.

Override WndProc and handle the WM_MOUSEWHEEL message yourself. Make sure you pass all other messages to base.WndProc(). I'd say this has a good probability of solving your problem.