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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Insert LineSegments from code

Thread ID:





78338 Dec 9,2008 02:54 PM UTC Dec 11,2008 03:58 AM UTC WinForms 3
Tags: Diagram
Andrzej Pienkosz
Asked On December 9, 2008 02:54 PM UTC


I link 2 symbols by OrthogonalConnector but it wasn`t look to good. How can I add more LineSegments to link?

Administrator [Syncfusion]
Replied On December 10, 2008 06:17 AM UTC

Hi Andrzej,

The AddPoint() method can be used to define points in the path for the connector.

For example, the following code snippet does this,


OrthogonalConnector o = new OrthogonalConnector(new PointF(0,0), new PointF(50, 50));
o.AddPoint(new PointF(50, 100));


The above code produces the Orthogonal connector of shape |_

Let me know if you shall need any further clarifications in this regard, Thanks!

Happy coding!

- Ajeet

Andrzej Pienkosz
Replied On December 10, 2008 03:28 PM UTC


I still have problems. This is my code:
OrthogonalConnector o = new OrthogonalConnector(new PointF(0,0), new PointF(100,100));

o.HeadDecorator.DecoratorShape = DecoratorShape.FilledFancyArrow;
o.HeadDecorator.FillStyle.Color = Color.LightSkyBlue;
o.HeadDecorator.Size = new SizeF(10, 10);
o.EnableCentralPort = true;


I get connector with shape |_

I was trying use AddPoint to get something like -|_ but it doesn`t work :(

How to do it?


Administrator [Syncfusion]
Replied On December 11, 2008 03:58 AM UTC

Hi Andrzej,

As mentioned in my previous post, you need to use the "AddPoint()" method to define the points in the "path" of the connector.

Also, care must be taken that the path is directional in "Perpendicular" respect, so every "next" point defined in the path should have atleast any one match in the value of "X" or "Y".

Thus, for you requirement, the following codes draws a connector of your desired shape. The code snippet is as follows:


OrthogonalConnector o = new OrthogonalConnector(new PointF(0, 0), new PointF(50, 0));
o.AddPoint(new PointF(50, 100));
o.AddPoint(new PointF(100, 100));


Please note here the way the path is defined. It draws in the following order:
1. From (0,0) to (50,0)
2. From (50,0) to (50,100)
3. From (50,100) to (100,100)

Thus, this gives you the desired shape of an flipped "S".

Let me know if you shall need any further clarifications in this regard.

Happy Coding!

- Ajeet


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon