We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Connector EndShapeConnectedTo does not appear to have any effect

Hello,I am trying to use the connector to draw an arrow between two objects but EndShapeConnectedTo appears to be ignored. Here is the code below:


   var startBox = slide.Shapes.AddAutoShape(ShapeType.Rectangle, x, y, 30, 30);
   var targetBox = slide.Shapes.AddAutoShape(ShapeType.Rectangle, x - 20, y + 15, 5, 5);

   var connector = slide.Shapes.AddConnector(ShapeType.Line, x, y + 15, 10, 10);       // Needed so the arrow shows up by where it is connected

   connector.StartShapeConnectedTo = startBox;
   connector.StartShapeConnectionSiteIndex = 1;
   connector.EndShapeConnectedTo = targetBox;
   connector.EndShapeConnectionSiteIndex = 2;

   connector.LineFormat.EndArrowheadStyle = LineArrowheadStyle.Triangle;
   connector.AsIShape.LineFormat.FillFormat.FillType = FillType.Solid;
   connector.AsIShape.LineFormat.FillFormat.SolidFillColor.Color = color;

Note that if I leave off the targetBox and connect the connector only to the startBox, the arrow points inside the startBox (from top left corner, arrow pointing toward the bottom right corner). I could find no way to control where the arrow goes so I'm now trying to point it at a target box.

Also, I saw in some older forum posts that where the connector is created can be random. This seems to be incorrect. The connector seems to show up exactly where it is placed, and when the user tries to move it, it only then jumps to the location where it was connected.

Hi Jason,

Thank you for the details.

To get a better understanding of your issue, we would request you to please share the generated file and the expected resultant file with us. We will check the issue and get back to you.

Thanks & Regards,