Need help with Paint problems with .NET control (PictureBox)
Posted on 2004-10-17
I have a simple application where I'm using GDI+ objects to draw text onto a PictureBox. In the form's Paint method, I've got a call to redraw the text and that works fine when you move a window through the PictureBox.
However, if you move another window on top of the PictureBox, then switch back to my application, the PictureBox redraws that area to the default background colour after my form paint code runs.
What is the proper way to make sure that a control gets repainted when needed?