C# Disable RichTextBox Smooth Scrolling
( January 20th, 2013 Tips & Tricks ) - lo-fi/printable version

In this article I’ll show you how to disable RichTextBox‘s Smooth Scrolling – aka make RichTextBox scroll line by line. I know this is a problem for many developers, it was a problem for me too, so that’s why I decided to post this code snippet.
 

Fixing it

Well, there’s no easy way to fix it and since there’s no other option, you’ll have to make a custom RichTextBox and override the WndProc() function.

Basically, you have to disable the original smooth scrolling and then use SendMessage() send scroll messages.

Before starting, you’ll need to add this namespace:

We’ll use the following line to send a message to the RichTextBox to scroll

Now, you must create your own control, which inherits from RichTextBox. I’ll post the complete code, and I’ll explain it by using comments:


No comments yet.
Have something to say?