[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;
}
}
}
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.
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.