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.

ConnectionPoint Mouse Move

Thread ID:

Created:

Updated:

Platform:

Replies:

93638 Mar 25,2010 11:37 AM Feb 21,2018 07:47 AM Windows Forms 7
loading
Tags: Diagram
Domenico Mozzone
Asked On March 25, 2010 11:37 AM

Dear Support,
I need help to change the position of a ConnectionPoint of a symbol using the mouse. I'm trying to implement follows steps.
1. Mouse down (on the Connectionpoint) -> selection ConnectionPoint
2. Move mouse -> move (redrawing the ConnectionPoint on the Mouse Pointer)
3. Mouse up -> reposition

Is there an example where I can find ideas

Thank You

Best Regards

Domenico

Melba Winshia [Syncfusion]
Replied On March 30, 2010 08:52 AM

Hi Domenico,

Thank you for your interest in Syncfusion Products.

Please use below code to change the position of a ConnectionPoint of symbol using the mouse:

[C#]

private void diagram1_MouseMove(object sender, MouseEventArgs e)
{
PointF mouseLocation = diagram1.Controller.ConvertToModelCoordinates(e.Location);
Node nd = diagram1.Controller.GetNodeAtPoint(mouseLocation);

if (nd != null)
{
ConnectionPoint cp = HandlesHitTesting.GetConnectionPointAtPoint(nd, mouseLocation);
if (cp != null)
{
Cursor.Current = Cursors.Hand;
cp.Position = Position.Custom;
PointF portLocation = nd.ConvertToNodeCoordinates(mouseLocation);
cp.OffsetX = portLocation.X;
cp.OffsetY = portLocation.Y;
}
}
}


Please let me know if this helps.

Thanks,
Melba



Johan De Mulder
Replied On December 6, 2013 01:17 PM

Moving the port when the mouse moves over it works. But how do you select a port by clicking on it, then move it to a new position and release the mouse (similar to a node).

1. Mouse down (on the Connectionpoint) -> selection ConnectionPoint
2. Move mouse -> move (redrawing the ConnectionPoint on the Mouse Pointer)
3. Mouse up -> reposition

Ashok Kumar V [Syncfusion]
Replied On December 10, 2013 02:37 AM

Hi Johan,


Thanks for your interest in Syncfusion product.


We regret to inform you that we don’t have support to select and move the connection point like node.

 However, we suggest you to activate “ConnectionPointTool” to move the Connection point to the

 required location. Please refer the below code snippet.


[C#]


private void Form1_Load(object sender, EventArgs e)

        {

            OrthogonalConnector connect = new OrthogonalConnector(new PointF(100, 200), new PointF(400, 200));

            ConnectionPoint cp = new ConnectionPoint();

            cp.VisualType = PortVisualType.Triangleport;

            cp.Size = 20;

            connect.Ports.Add(cp);

            diagram1.Model.AppendChild(connect);

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            diagram1.Controller.ActivateTool("ConnectionPointTool");

        }

 

        private void button2_Click(object sender, EventArgs e)

        {

            diagram1.Controller.DeactivateTool(diagram1.Controller.ActiveTool);

        }


Please try the below attached sample and let us know if you have any queries.

 

Regards,


Ashok Kumar.



Forum_93638_edacd315.zip

Johan De Mulder
Replied On December 13, 2013 11:13 AM

Hello Ashok,

The video in the attached sample looks like a good alternative to move a certain port.
However the code that is included in the zip file does not correspond with what is demonstrated in the video. The code shows how to add additional ports.

Can you please provide the code that corresponds with the video?

Best regards,
Johan

Ashok Kumar V [Syncfusion]
Replied On December 30, 2013 06:13 AM

Hi Johan,

 

Thanks for your update.

 

Please note that the connection point tool is an interactive tool for inserting, deleting and moving the 

connection points on diagram nodes. You can insert a connection point by clicking the node and delete a 

connection point by holding CTRL and clicking the node. Also, you can move the connection point by 

pressing the left mouse click over the connection point and dragged to the required location. Here is the 

documentation link for your reference.

 

Link: http://help.syncfusion.com/ug/windows%20forms/diagram/documents/diagrambuilder.htm

 

Please let us know if you have any queries.

 

Thanks,


Ashok Kumar.


david adele
Replied On February 20, 2018 04:19 AM

Interesting

Naganathan Ganesh Babu [Syncfusion]
Replied On February 21, 2018 07:47 AM

Hi Johan, 
 
Thanks for the update  
 
Please let us know whether you need any assistance  
 
Regards, 
 
Naganathan K G 


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.

;