Try this:

vb.net Code:
  1. Dim g As Graphics
  2.  
  3. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  4.     g = Graphics.FromHwnd(Me.Handle)
  5. End Sub
  6.  
  7. Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
  8.     Static lastPosition As Point = e.Location
  9.     g.DrawLine(Pens.Red, lastPosition, e.Location)
  10.     lastPosition = e.Location
  11. End Sub

This is just the basic code. In addition to this you might want to trap the MouseDown and MouseUp events to determine when to start drawing and when to stop.