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.

SFDiagram- MouseLeftButtonDown getting mouse position relative to a page

Thread ID:

Created:

Updated:

Platform:

Replies:

125951 Sep 14,2016 04:07 AM Sep 15,2016 02:11 AM WPF 2
loading
Tags: SfDiagram
tomer
Asked On September 14, 2016 04:07 AM


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 04:11 AM


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


e.GetPosition(diagram.Page)

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

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.

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.

;