Need Help In Drawing
<p>Following is my code. i am trying to draw line, filled rectangle, etc.....</p>

<p>Problem is that, lets suppose i draw a line but when i try to draw an other line first drawn line disappears. so i want help that i'll be able to draw multiple shapes on a form and first draw lines don't disappears.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace finalPaint
{
    public partial class Form1 : Form
    {

        List&lt;Point&gt; points = new List&lt;Point&gt;();
        Rectangle rect;
        Point first;
        Point last;
        string op;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                points.Add(e.Location);
                rect = new Rectangle(rect.Left, rect.Top, e.X - rect.Left, e.Y - rect.Top);
                last = e.Location;
                this.Invalidate();
                this.Update();
            }
        }
        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {

        }
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            switch (op)
            {
                case "toolStripButton1":
                    {
                         if (points.Count &gt; 2)
                         {
                             e.Graphics.DrawLines(Pens.Black, points.ToArray());

                         }
                    }
                        break;
                case "toolStripButton2":
                        {
                            using (Pen pen = new Pen(Color.Red, 2))
                            {
                                e.Graphics.DrawRectangle(pen, rect);
                            }
                        }
                        break;

                case "toolStripButton3":
                        {
                            Pen pen = new Pen(Color.Red, 2);
                            e.Graphics.DrawLine(pen, first, last);
                            this.Update();

                        }
                        break;

                case "toolStripButton4":
                        {
                            using (SolidBrush pen = new SolidBrush(Color.Red))
                            {
                                e.Graphics.FillRectangle(pen, rect);
                            }
                        }
                        break;

                case "toolStripButton5":
                        {
                            using (SolidBrush pen = new SolidBrush(Color.Red))
                            {
                                e.Graphics.FillEllipse(pen, rect);
                            }
                        }
                        break;

                case "toolStripButton6":
                        {
                            using (Pen pen = new Pen(Color.Red,2))
                            {
                                e.Graphics.DrawEllipse(pen, rect);
                            }
                        }
                        break;
                default:
                    break;
            }
        }
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            rect = new Rectangle(e.X, e.Y, 0, 0);
            first = e.Location;
            this.Invalidate();
        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void selectedButton(object sender, EventArgs e)
        {
            foreach (ToolStripButton btn in toolStrip1.Items)
            {
                btn.Checked = false;
            }

            ToolStripButton btnClicked = sender as ToolStripButton;
            btnClicked.Checked = true;
            op = btnClicked.Name;
        }
    }
}
</code></pre>
