We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NodeMouseEventArgs don´t contain infos about X,Y,Button

Thread ID:

Created:

Updated:

Platform:

Replies:

37457 Nov 22,2005 12:56 PM UTC Nov 23,2005 04:07 PM UTC WinForms 2
loading
Tags: Diagram
Johann Schraml
Asked On November 22, 2005 12:56 PM UTC

Hi, I do have to register a lot of EventHandler on my CustomSymbol like MouseClick, MouseEnter, MouseLeave, ... . Therefore I added on the Model of my CustomSymbol the following: Model.Click += new NodeMouseEventHandler(Model_Click); Model.DoubleClick += new NodeMouseEventHandler(Model_DoubleClick); Model.MouseEnter += new NodeMouseEventHandler(Model_MouseEnter); MouseLeave += new NodeMouseEventHandler(Model_MouseLeave); My problem is that I need additional informations to the standard NodeMouseEventArgs like the position of the fired mouse event and the button (mouse right/left). How can I get this? greetz, Uli

Administrator [Syncfusion]
Replied On 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.,

Johann Schraml
Replied On November 23, 2005 04:07 PM UTC

Thanks a lot. Uli

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;