Thanks, Linda, for trying to help.
Unfortunately I'm running this particular project on VStudio 2002/.NET 1.0, which doesn't appear to have a DoubleBuffered property or any other double buffering support. Or does it?
Regards,
Axel Dahmen
---------------------
> Hi Axel,
>
[quoted text clipped - 61 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu[MSFT] - 20 Nov 2007 10:18 GMT
Hi Axel,
Yes, you're right. Double buffering is only supported from .NET 2.0.
You may have a try using the option 1 I suggested in my first reply, i.e.
draw images off-screen to sovle your problem.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Axel Dahmen - 02 Dec 2007 19:03 GMT
Hi Linda,
I've now tried your suggestion drawing an image off-screen and copying it back to the control's Paint() event Graphics object.
Unfortunately the resulting animation still flickers. It seems that the control's intrinsic WM_ERASEBKGND message causes the flickering. Can I keep the control from erasing its background before raising the Paint() event? I could perform an initial FillRectangle() myself within the Paint() event then.
Your help is quite appreciated.
Best regards,
www.axeldahmen.de
Axel Dahmen
---------------
> Hi Axel,
>
[quoted text clipped - 8 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu[MSFT] - 04 Dec 2007 10:20 GMT
Hi Axel,
Thank you for your feedback!
> It seems that the control's intrinsic WM_ERASEBKGND message causes the flickering.
Yes, it may be the reason.
> Can I keep the control from erasing its background before raising the Paint() event?
Yes. You can do it without any problem.
If the problem is still not solved, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Axel Dahmen - 08 Dec 2007 07:18 GMT
> > Can I keep the control from erasing its background before raising the
> Paint() event?
>
> Yes. You can do it without any problem.
Er, well, fine... I've found a great article on how to do this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2455032&SiteID=1
It's using the control's SetStyle() member function.
Regards,
www.axeldahmen.de
Axel Dahmen
Bob Powell [MVP] - 15 Feb 2008 08:03 GMT
You should override the OnPaintBackground to do nothing (don't call the
base class).
You can set double buffering on using the SetStyle method and
ControlStyles.DoubleBuffer.
If you need to you can use manual double buffering.
Se my site for details of all these techniques.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> Thanks, Linda, for trying to help.
>
[quoted text clipped - 69 lines]
>>
>> This posting is provided "AS IS" with no warranties, and confers no rights.