Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Mouse position on mouse up (Read 2146 times)
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Mouse position on mouse up
Jul 10th, 2014 at 4:59am
Print Post  
I trying to get position of mouse over the digram on mouse up.

I cnat find anyway work.


Code
Select All
private void form_MouseUp(object sender, MouseButtonEventArgs e)
   {

   System.Drawing.Point  ptCursor = System.Windows.Forms.Cursor.Position;
   Point pe = new Point(ptCursor.X, ptCursor.Y);

 




The problem is this return mouse position in reference to screen.
My diagram, is inside a scrolbox, need obtain the point on mouse up in reference to diagram, not to screen.

Some sugestion please?
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Mouse position on mouse up
Reply #1 - Jul 10th, 2014 at 5:39am
Print Post  
Ignore this question, i found how do this.
Thk
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Mouse position on mouse up
Reply #2 - Jul 10th, 2014 at 6:32pm
Print Post  
My method fail on extended desktop.
need some way to pickup mouse x y position on mouse up, but in reference to the diagram not to the screen.

Some idea?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mouse position on mouse up
Reply #3 - Jul 10th, 2014 at 6:58pm
Print Post  
Try calling MouseButtonEventArgs.GetPosition(diagram.DocumentPlane);
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Mouse position on mouse up
Reply #4 - Jul 10th, 2014 at 8:43pm
Print Post  



Thankyou finally make work witha  simple call to

System.Windows.Point testp = e.GetPosition(this.form);
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint