BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Domenico,
Diagram controls MouseLeftButtonDown event is used for
internal purpose. So you can use Addhandler method to hook new event handler. Kindly
find the code snippet below,
DiagramControl diagramcontrol=new DiagramControl();
diagramcontrol.AddHandler(MouseLeftButtonDownEvent, new RoutedEventHandler(OnMouseLeftButtonDown), true);
private void OnMouseLeftButtonDown(object sender, RoutedEventArgs e)
{
System.Windows.Forms.Cursor.Position = new System.Drawing.Point(0, 0);
}
To change the mouse cursor dynamically, kindly find
the code snippet below
System.Windows.Forms.Cursor.Position = new System.Drawing.Point(0, 0);
Note : Need to add System.Windows.Forms and
System.Drawing dll
Regards,
Parthiban A.
Hi Domenico,
Kindly find the responses below,
S.No |
Queries |
Responses |
1. |
Change the mouse pointer shape from default to cross
for example and viceversa, |
We can change the pointer shape by setting type for
Cursor property. But couldn’t set pointer type for diagram control objects
like node, connector, diagram page. Since those are set by internally.
However we can set cursor for any framework element. We have created sample
in which set button as node, while drag and drop from the palette. When mouse
over that button, cursor changed to Hand. For more information please refer the provided
sample.
Code Snippet: (sender as Button).Cursor = Cursors.Hand;
|
2. |
Get mouse coordinates in the(x,y) diagram reference
system |
Mouse.GetPosition method will return the mouse
co-ordinates with respect to the IInputElement. We have created a sample,
which will show the mouse co-ordinates while double clicking on the diagram
control.
void
view_MouseDoubleClick(object sender, MouseButtonEventArgs e) { MessageBox.Show(Mouse.GetPosition(view).ToString());
} |
Regards,
Parthiban
A.