How To Set the Custom Position For a Label

29 Feb 20161 minute to read

We can adjust the label position by setting the Position property as ‘Custom’. Then, we have to set the Offset values for the X and Y coordinates to specify the label position.

// Setting custom position for a label 

outerRect.Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label()); 

outerRect.Labels[0].Text = "Rectangle"; 

outerRect.Labels[0].Position = Position.Custom; 

outerRect.Labels[0].OffsetX = 50; 

outerRect.Labels[0].OffsetY= 65;
' Setting custom position for a label 

outerRect.Labels.Add(New Syncfusion.Windows.Forms.Diagram.Label()) 

outerRect.Labels(0).Text = "Rectangle" 

outerRect.Labels(0).Position = Position.Custom 

outerRect.Labels(0).OffsetX = 50 

outerRect.Labels(0).OffsetY= 65