title: Drawing a line while moving the mouse and holding the right-click button
body: <p>I would like to draw a line on the panel as I move my mouse while holding the right-click button. Here's what I've tried so far:</p>
  
  <pre><code>private void panel1_MouseDown(object sender, MouseEventArgs e)
  {
      Point point = panel1.PointToClient(Cursor.Position);
      Point cordinatedClikedPoint = new Point(xPanelPosition, yPanelPositon);
      DrawPoint((point.X), (point.Y), Color.Navy);                
  }
  
  public void DrawPoint(int x, int y, Color color)
  {
      Graphics g = this.panel1.CreateGraphics();
      Pen pen = new Pen(color);
      g.DrawRectangle(pen, x, y, 3, 3);
  }
  </code></pre>