Dim drawing As Boolean, my_x As Long, my_y As Long
Dim old_x As Long, old_y As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
drawing = True
old_x = X
old_y = Y
my_x = X
my_y = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If drawing Then
Me.DrawMode = vbNotXorPen
Line (my_x, my_y)-(old_x, old_y), , B
Line (my_x, my_y)-(X, Y), , B
End If
old_x = X
old_y = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
drawing = False
DrawMode = vbCopyPen
Line (my_x, my_y)-(X, Y), , B
End Sub
|