Make a panel object redraw?

Mark Wills

Member
Joined
Jul 11, 2004
Messages
13
Location
Worldwide
Programming Experience
10+
Hi there,

I am vb.net newbie.

Am am using GDI+ to draw onto a panel control - all works ok... However, when I resize the form (it's a windows forms project) the panel erases itself and i can't make it refresh.

I want the panel to refresh itself (and the stuff that was on it) when it is resized etc, hopefully without having to manually re-draw everything again. Is this possible? Any suggestions?

Many thanks

Mark Wills (UK)
 
Do the custom drawing in the Paint method of the panel. The paint method is called anytime the panel's graphics becomes invalid (i.e. when it is resized).

If that's not possible (or inconvienient), call the procedure that paints the panel in the panel's resize method.
 
Back
Top