title: Paint on panel show line when mouse drag right to left
body: <pre><code>    private void panel1_Paint(object sender, PaintEventArgs e)
      {
          Graphics g = panel1.CreateGraphics();
          g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
          using (Pen p = new Pen(Color.White))
          {
  
              for (int i = panel1.Width; i &gt;= 0; i -= 40)
              {
                  g.DrawLine(p, i, 0, i, panel1.Height);
  
              }
          }
  
          using (Pen p = new Pen(Color.White))
          {
              // Draw all visible, vertical gridlines                     
              for (int i = panel1.Height; i &gt;= 0; i -= 40)
              {
                  g.DrawLine(p, 0, i, panel1.Width, i);
  
              }
          }
  
          Pen pen = new Pen(Color.Red, 6);
          g.DrawLine(pen, new Point(50,80), new Point(8050,  80));
  
      }
  </code></pre>
  
  <p>Output:
  <img src="https://i.stack.imgur.com/UhneJ.png" alt="enter image description here"></p>
  
  <p>its fine for me.
  but i want when i click and drag mouse right to left example(10px) the panel show me the next 10px line form right(that is hidden ) and hide 10px  from left.</p>
  
  <p>How can I do this...
   Please someone help me.</p>