Setting double-bufferring on the form will not affect the components hosted
by the form. Panel does not double-buffer by default so my advise would be
to derive a class from Panel and turn on double-buffering in the constructor
of that class.
If you're drawing in response to the Panel's Paint event then you can either
move you code to the derived classes OnPaint protected method or respond to
that objects Paint event.
--
Bob Powell [MVP]
Visual C#, System.Drawing
The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
The GDI+ FAQ RSS feed:
http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS:
http://www.bobpowell.net/tipstricks.xml
Bob's Blog:
http://bobpowelldotnet.blogspot.com/atom.xml
"Jason" <bo******@msu.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have created a 2d isometric game map using tiles and now I'm trying to
move around my map..when i go near the edge of the map I want to redraw
the map to show new parts of the map however the screen flicker a good bit
while this happens. I'm using GDI+ and it say in MSDN that double buffering will
fix this but it didnt work for me.
this.Setstyle(Controlstyles.DoubleBuffer, true );
this.Setstyle(Controlstyles.UserPaint, true );
this.Setstyle(Controlstyles.AllPaintingInWmPaint, true);
this.Updatestyles();
I set double buffering on the form, but I wonder if the problem is that
I'm using a panel control to do all my GDI + drawing in. When I set double
buffering on a form does that include all object on the form(ie my panel).
I cant set double buffer on a panel( i tired).
What else could cause this flicker? Any ideas?
Thanks
Jason