Double buffering the scroll event of a RichTextBox
-
Hello, does anyone know how to use DrawString / DoubleBuffer / UserPaint / AllPaintingInWmPaint to paint your own RichTextBox? This is for a news ticker that contains multiple fonts, font colors and embedded images. The autoscrolling is working great, but the flicker is really bad and I was told that double buffering is the way to go (is it, or is there something else, like making an image and double buffering its movement??). Any pointers would be really appreciated! :omg:
-
Hello, does anyone know how to use DrawString / DoubleBuffer / UserPaint / AllPaintingInWmPaint to paint your own RichTextBox? This is for a news ticker that contains multiple fonts, font colors and embedded images. The autoscrolling is working great, but the flicker is really bad and I was told that double buffering is the way to go (is it, or is there something else, like making an image and double buffering its movement??). Any pointers would be really appreciated! :omg:
You could override the RichTextBox class, and in the constructor:
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);