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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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:

[C#] //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;

 

[VB.NET] '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

 

Article ID: Published Date: Last Revised Date: Platform: Control:
168 04/30/2011 07/10/2014 Windows Forms Diagram
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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