Auto Redraw graphics in a Panel

british87

New member
Joined
Jul 27, 2008
Messages
3
Programming Experience
Beginner
Hi everyone,

My question is very simple. How can I set my Panel component to automatically redraw it's content when it's repainted. Basically, I draw a bunch of shapes using the Graphics object of my Panel, but when the panel repaints itself, it clears everything I drew. In VB6 this was achieved by setting the 'AutoRedraw' property to 'true'. How can this be achieved easily in VB.NET? My drawing is a bit complicated to actually be fully redrawn from the subroutine that first drew it (takes too long, it's not very pleasant).

Thanks!

british
 
In .Net you draw to controls with Paint event and use the provided e.Graphics instance. If you don't want to draw some large static composition again you have to draw this to a Bitmap and use it as background image or draw it along with other dynamic painting by using the DrawImage method.
 
Back
Top