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: November 16, 2018).
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:





125951 Sep 14,2016 08:07 AM UTC Sep 15,2016 06:11 AM UTC WPF 2
Tags: SfDiagram
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


Replied On September 14, 2016 08:11 AM UTC

Answering to myself....need to use 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: 
diagram.MouseLeftButtonDown += diagram_MouseLeftButtonDown; 
void diagram_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 
Point point = e.GetPosition(diagram.Page); 
Here, diagram is instance of SfDiagram. 
Keerthivasan R. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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