title: draw a dot in a form on click event
body: <p>Any help would be appreciated. How do I create a colored dot on a panel on where a user clicks his mouse? I can get the coordinates of the mouse click and output it through a message box but I can't draw the dot on the panel where the user clicked. I have these codes tried.</p>
  
  <pre><code>Private Sub createDot(x, y)
      MsgBox(x &amp; " " &amp; y)
      Dim myGraphics As Graphics = Me.CreateGraphics
  
      Dim myPen As Pen
  
      myPen = New Pen(Drawing.Color.Maroon, 20)
  
      myGraphics.DrawRectangle(myPen, x, y, 1, 1)
  
  End Sub
  
  Private Sub Panel1_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseClick
      missed += 1
      lblMissed.Text = missed
      Dim x, y As Integer
      x = e.X.ToString
      y = e.Y.ToString
      createDot(x, y)
  End Sub
  </code></pre>
  
  <p>Thanks!</p>