I have a problem: my application needs to draw some images on panels.
I make it on Paint(..) event.
But if I move application window then form and all controls will repaint.
How can I get away from it?
May be I should change event for paiting?
I have tried to draw into Load(..) event, but application nothing draw into panels in this way.
Only parts used are drawn by the application. Therefore, whenever parts not previously visible are uncovered (by moving that window or windows above it, or resizing, minimizing/maximizing etc.) the missing parts need to be redrawn, which is what you’re seeing.
If you cannot just redraw the parts, you can for instance use a bitmap and a
PictureBoxto cache the drawn data so that redrawing the window only requires the bitmap to be transferred to the screen without actually redrawing the contents of the bitmap.In that case you draw your stuff to the bitmap canvas instead of the form canvas.