Try the following code:
VB Code:
  1. Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
  2.         Static Dim secondclick As Boolean
  3.         Static mousepos1, mousepos2 As Point
  4.         If e.Button = MouseButtons.Left Then
  5.             Dim  g As Graphics = Me.CreateGraphics
  6.             If secondclick = False Then
  7.                 Me.Refresh() ' comment this line and try the next line to note the difference.
  8.                 ' Me.Invalidate()
  9.                 mousepos1 = New Point(e.X, e.Y)
  10.                 secondclick = True
  11.             Else
  12.                 mousepos2 = New Point(e.X, e.Y)
  13.                 secondclick = False
  14.                 g.DrawLine(New Pen(Color.Black, 1), mousepos1.X, mousepos1.Y, mousepos2.X, mousepos2.Y)
  15.           End If
  16.             g.DrawLine(New Pen(Color.Black, 1), e.X, e.Y - 5, e.X, e.Y + 5)
  17.             g.DrawLine(New Pen(Color.Black, 1), e.X - 5, e.Y, e.X + 5, e.Y)
  18.             g.Dispose()
  19.         End If
  20. End Sub

How can you describe this difference between Refresh and Invalidate? Doesn't Refresh call Invalidate?