Articles in this section
Category / Section

How do I add ports to my symbol?

2 mins read

How do I add ports to my symbol?

The following code sample shows how the ports were added to the custom symbol (MySymbol)

[C#]

private CirclePort leftport; 
private CirclePort rightport;
// Add these lines to MySymbol's Constructor
// Port locations
leftport = new CirclePort(new PointF(0, this.Height / 2));
rightport = new CirclePort(new PointF(this.Width, this.Height / 2));
// Append CirclePorts to MySymbol
AppendChild(leftport);
AppendChild(rightport);
// Make CenterPort visible
this.CenterPort.Visible = true;

[VB.NET]

Private leftport As CirclePort 
Private rightport As CirclePort
' Add these lines to MySymbol's Constructor
' Port locations
leftport = New CirclePort(New PointF(0, Me.Height / 2))
rightport = New CirclePort(New PointF(Me.Width, Me.Height / 2))
' Append CirclePorts to MySymbol
AppendChild(leftport)
AppendChild(rightport)
' Make CenterPort visible
Me.CenterPort.Visible = True

 

Conclusion

I hope you enjoyed learning about how to add ports to my symbol.

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 Syncfusion®, 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