chongo 2002
Dec 16th, 2000, 11:15 AM
I want to write a really simple program or so I think. All I want to do is draw a line wherever the mouse moves, like clicking and holding in paint and just moving the mouse around.(Without clicking just moving the mouse) I then want to be able to clear the form by a simple click. Any ideas? And Possibly add some color changes in there too?
Thanks
kedaman
Dec 17th, 2000, 12:18 PM
Paste this sample code to a form ;)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X
CurrentY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Button
Case 1 'left button draws lines
Line -(X, Y)
Case 2 'right button changes color
ForeColor = QBColor(Int(Rnd * 16))
Case 3 'both buttons clear the form
Cls
End Select
End Sub