Public Class Form1 Dim sp, ep As Point Dim lines As New List(Of Point()) Private Sub paint_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles paint.MouseDown sp = e.Location paint.Invalidate() End Sub Private Sub paint_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles paint.MouseMove ep = e.Location paint.Invalidate() End Sub Private Sub paint_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles paint.MouseUp lines.Add(New Point() {sp, e.Location}) paint.Invalidate() End Sub Private Sub paint_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles paint.Paint If Control.MouseButtons = Windows.Forms.MouseButtons.Left Then e.Graphics.DrawLine(Pens.Red, sp, ep) End If For Each line As Point() In lines e.Graphics.DrawLine(Pens.Red, line(0), line(1)) Next End Sub End Class