Re: Scrolling text that doesn't flicker



Hi James,

As Peter suggested, double buffering is an option to reduce flickering (the
only one I'm aware of as well). In the constructor of a class that derives
from Control (including the Form class) you can use the following code to
enable double buffering for that control (1.* applications):

this.SetStyle(ControlStyles.DoubleBuffer
| ControlStyles.AllPaintingInWmPaint
| ControlStyles.UserPaint, true);

In 2.0 apps, just set the Control.DoubleBuffered property to true (it uses the
new ControlStyles.OptimizedDoubleBuffer flag internally).

--
Dave Sexton

"pigeonrandle" <pigeonrandle@xxxxxxxxxxx> wrote in message
news:1163369002.125020.81540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have seen loads of different ways to do this, but the all seem to
yield the same result - text that doesn't flicker when it's moving too
slowly!
Does anyone know 'the best way' to make text scroll...

eg
Override OnPain and OnPaintBackground

Override WndProc

Use GDI

Use API

Or do i need to create some weird control in c++?!

Thanks in advance,
James



.



Relevant Pages

  • Re: Double Buffering and Initial Paint
    ... > when I turn on double buffering ... ... > the control which is being double buffered momentarily has the same ... > When this is set to false, flickering once again occurs, but the ... > my app, but STILL not have any flicker. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Double Buffering and Initial Paint
    ... when I turn on double buffering ... ... the control which is being double buffered momentarily has the same ... When this is set to false, flickering once again occurs, but the background ... my app, but STILL not have any flicker. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: I think I know why setstyle double buffering cases invalidOperationExceptions!
    ... auto-double buffering or manual buffering, and the first works, the second ... somehow taking control away and putting up that cursed dialog box. ... The fact that GDI+ take away my ability to control when the backbuffer is ... >> Here is some of the points and observations about my screensaver, ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: I think I know why setstyle double buffering cases invalidOperationExceptions!
    ... > to the screensaver and send it to them, there is a config option, where I ... > chose auto-double buffering or manual buffering, and the first works, the ... Showing how using flat 32 unmanaged code that gives ME control over ... > The fact that GDI+ take away my ability to control when the backbuffer is ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Generic Error in GDI+ related to DrawLine
    ... if it's a standard control and not a custom one then something else ... I do suspect a bug in the double buffering system that I can't put my finger ... Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.framework.drawing)