Gregers Newbie
Joined: 01 Feb 2004 Posts: 5
|
Posted: Feb 12th, 2004 09:11 AM Post subject: Freehand Drawing |
|
|
The Code below lets you draw whils't the left mouse button is depressed. You will need to add a redraw event to let it be visible when printed using the printform method.
| Code: | Dim DrawNow As Boolean
Private Sub Form_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawNow = True
CurrentX = X
CurrentY = Y
ElseIf Button = vbRightButton Then
Line -(X, Y)
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If DrawNow Then Line -(X, Y)
End Sub
Private Sub Form_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawNow = True
CurrentX = X
CurrentY = Y
ElseIf Button = vbRightButton Then
Line -(X, Y)
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawNow = True
CurrentX = X
CurrentY = Y
ElseIf Button = vbRightButton Then
Line -(X, Y)
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If DrawNow Then Line -(X, Y)
End Sub |
|
|