Try this:
vb.net Code:
Dim g As Graphics
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
g = Graphics.FromHwnd(Me.Handle)
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
Static lastPosition As Point = e.Location
g.DrawLine(Pens.Red, lastPosition, e.Location)
lastPosition = e.Location
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.