The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.,