I have the following code, which draws a ractangle on a picture box, but the
rectangle does not become visible until I overlay another Window over the
picture box and remove this window. How can I fix this problem?
private static void PictureBox1_paint( object sender, PaintEventArgs e )
{
// Get Graphics Object
Graphics g = e.Graphics;
// Create pen
Pen bluePen = new Pen( Color.Blue, 2 );
// Draw rectangle to screen
g.DrawRectangle( bluePen, 10, 10, 220, 150 );
bluePen.Dispose();
}
Thank You
Peter