Articles in this section
Category / Section

Alignment of the Diagram Nodes

4 mins read

In WinForms Diagram Control, we can align the diagram nodes by using Syncfusion.Windows.Forms.Diagram.Model’s “AlignmentType” property. The AlignmentType is an Enum which has two types, and it is explained below,

 

SelectedNode

 

It used to align the node based on the position of the first node contains SelectionList.  

For example:  

If the diagram contains 3 text nodes i.e. TextNode1, TextNode2 and TextNode3.  In the Diagram.View’s “SelectionList” contains the First Node is TextNode2. Then the others nodes aligned based on the TextNode2’s position.  

 

[C#]

 

diagram1.Model.AlignmentType = AlignmentType.SelectedNode;

 

[VB]

 

diagram1.Model.AlignmentType = AlignmentType.SelectedNode

 

 

BoundingRectangle.

 

It is used to align the nodes based on the total bounds area of the selected nodes.  

 

[C#]

 

diagram1.Model.AlignmentType = AlignmentType.BoundingRectangle;

 

[VB]

 

diagram1.Model.AlignmentType = AlignmentType.BoundingRectangle

 

 

 

Note:

The default value of the Syncfusion.Windows.Forms.Diagram..Model’s “AlignmentType” property is SelectedNode.

 

 

Conclusion

I hope you enjoyed learning about Alignment of the Diagram Nodes.

You can refer to WinForms Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusio, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied