Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic uncorrect positions by during drag & drop (Read 1493 times)
SeppiK
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 15th, 2008
uncorrect positions by during drag & drop
Nov 13th, 2008 at 8:57am
Print Post  
Hi,

before I using drag & drop to fill my diagram with nodes the positions were OK.

Now I´m using drag and drop.

Code
Select All
private void diagramView_DragDrop(object sender, DragEventArgs e) {
            if (e.Data.GetDataPresent(DataFormats.StringFormat)) {
                string selected = e.Data.GetData(System.Windows.Forms.DataFormats.StringFormat).ToString();

                coordinates pos = new coordinates(e.X, e.Y);
 



e.X and e.Y are the position on the screen not in the diargram. From this follows that my nodes were draw on other side of the screen.

How can I get the right coordinates?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: uncorrect positions by during drag & drop
Reply #1 - Nov 13th, 2008 at 11:04am
Print Post  
Use Control.PointToClient to get the DiagramView coordinates for the screen point, and then DiagramView.ClientToDoc to get the document coordinates.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SeppiK
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 15th, 2008
Re: uncorrect positions by during drag & drop
Reply #2 - Nov 13th, 2008 at 1:07pm
Print Post  
It works!!

Thanks for your great support every time!

SeppiK
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint