AD
Administrator
Syncfusion Team
November 23, 2005 03:20 PM UTC
Hello Ulrich,
The position or cursor location of the mouse click can be determined by using the System.Cursor.Position property, and converting the obtained screen coordinates to the diagram model''s world coords using a sequence of the Control.PointToClient(PointF), diagram.View.DeviceToView(PointF) and diagram.View.ViewToWorld(PointF) methods.
Getting hold of the mouse buttons for the click/doubleclick events is however going to be tricky as the Windows Forms Control.Click and Control.DoubleClick events that trigger the diagram.Model.NodeClick and NodeDoubleClick events do not provide any information about the mouse buttons.
One way to determine the mouse button state, and position as well, from within the NodeClick/NodeDoubleClick handlers would be by taking advantage of the fact that the Control.MouseDown event will always be fired before the Control.Click and Control.DoubleClick events. So your application can simply provide a handler for the diagram control''s MouseDown event, and update a variable that keeps track of the mouse position and button state. You could then refer to this buttonstate information from your NodeClick/NodeDoubleClick handlers.
Thanks,
Prakash Surendra
Syncfusion Inc.,