June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to draw custom elements on a form and make sure they are not erased when the form is minimized or obscured.
Place all your drawing code in an event handler for the Control.Paint or Form.Paint events.
When any part of a form disappears from view, Windows automatically discards all of its graphical information. When the form reappears, Windows fires the Paint event to instruct the form to redraw itself. Thus, any custom painting logic should always be coded in a Paint event handler so that the window is refreshed accurately. To make matters even easier, the Paint event always provides a PaintEventArgs parameter. This PaintEventArgs references a Graphics object that represents the drawing surface ...
Read now
Unlock full access