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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SFDiagram- MouseLeftButtonDown getting mouse position relative to a page

Thread ID:

Created:

Updated:

Platform:

Replies:

125951 Sep 14,2016 08:07 AM UTC Sep 15,2016 06:11 AM UTC WPF 2
loading
Tags: SfDiagram
tomer
Asked On September 14, 2016 08:07 AM UTC


Hi ,

I am trying to get the position of the cursor relative to the page

Looks like that the following code doensot get the correct point and i need to do some translation?


  private void Diagram_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
          var point =       e.GetPosition(diagram)

  }

Thanks in advance

Tomer

tomer
Replied On September 14, 2016 08:11 AM UTC


Answering to myself....need to use diagram.Page


e.GetPosition(diagram.Page)

Keerthivasan Ramamoorthy [Syncfusion]
Replied On September 15, 2016 06:11 AM UTC

Hi Tomer, 
Yes, Please get the position of Mouse with respect to Page. We have provided a code example to represent this. Please refer to the below code example. 
 
Code example: 
//MouseLeftButtonDown 
diagram.MouseLeftButtonDown += diagram_MouseLeftButtonDown; 
 
void diagram_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 
{ 
Point point = e.GetPosition(diagram.Page); 
} 
 
Here, diagram is instance of SfDiagram. 
 
 
 
Regards, 
Keerthivasan R. 
 


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

;