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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Sometimes labels are drawn outside my symbol. Why?

Platform: WinForms |
Control: Diagram

Sometimes labels are drawn outside my symbol. Why?

When you add a label to your symbol and specify its anchor using the BoxPosition Enumeration, you need to remember that the label's anchor point will be its center. Therefore, by specifying BoxPosition.TopLeft, you are setting the center/anchor point of the label to be the top left of your symbol. To ensure that the label text is within the symbol, you should set appropriate offsets, such as if you want the label to begin at the top left of your symbol:


//Add new label to MySymbol Label lbl = AddLabel("My Symbol", BoxPosition.TopLeft);
//Offsets for the label lbl.OffsetX = this.lbl.Width/2; lbl.OffsetY = this.lbl.Height/2;



'Add new label to MySymbol Dim lbl As Label =  AddLabel("My Symbol",BoxPosition.TopLeft)   'Offsets for the label lbl.OffsetX = Me.lbl.Width/2 lbl.OffsetY = Me.lbl.Height/2


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile