Private PointX() As Single
Private PointY() As Single
Private NumPoints As Integer
Private Drawing As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
' Let MouseMove know we are drawing.
Drawing = True
' Start from scratch
NumPoints = 0
Cls
' Start drawing here.
CurrentX = X
CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
' Make sure we are drawing.
If Not Drawing Then Exit Sub
' Save the new point.
NumPoints = NumPoints + 1
ReDim Preserve PointX(1 To NumPoints)
ReDim Preserve PointY(1 To NumPoints)
PointX(NumPoints) = X
PointX(NumPoints) = X
' Draw to the point.
Line -(X, Y)
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
' Stop drawing.
Drawing = False
End Sub
|