![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to make a Scribble application in VJ# using .NET event handlers. I made a form, added a picture box to it, created a Bitmap object and set it as it's "Image" property. Now, I have event-handlers for MouseDown, MouseUp, and MouseClick, but what about MouseDrag ? I need MouseDrag because I would be scribbling with the mouse button on hold. None of the event handlers under "Drag-and-Drop" category seems to be right for this purpose. Please help me with this problem, as I was about to make this small app a part of a bigger application with more functionality. |
#3
| |||
| |||
|
|
are you using WinForms or Swing? |
|
on WinForms, maybe you just watch for MouseMove events and see if the mouse key you are interested in is down during the mouse motion (also watch for MouseUp events in case user releases the mouse button without moving the mouse after that) |
|
on Swing you have MouseListener and MouseMotionListener. Only the second has MouseMove and MouseDrag methods. So you have to use addMouseMotionListener method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ George Birbilis <birbilis (AT) kagi (DOT) com Microsoft Most Valuable Professional MVP J# for 2004, 2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + QuickTime (Delphi & ActiveX: VB, PowerPoint, .NET) + Plugs (InterProcess/Internet communication) http://www.kagi.com/birbilis + Robotics http://www.mech.upatras.gr/~robgroup .................................................. ....................... |
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |