Delete rectangle using .NET?
        Posted  
        
            by C. Karunarathne
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by C. Karunarathne
        
        
        
        Published on 2010-03-30T05:50:53Z
        Indexed on 
            2010/03/30
            6:23 UTC
        
        
        Read the original article
        Hit count: 413
        
Can I delete the old rectangle which I have drawn and draw a new rectangle?
private void panel1_MouseClick(object sender, MouseEventArgs e)
{
        Graphics g = this.panel1.CreateGraphics();
        Pen pen = new Pen(Color.Black, 2);
        g.DrawRectangle(pen, 100,100, 100, 200);
        g.dispose();
}
© Stack Overflow or respective owner