Nevron Forum

Moving figure label below the figure

https://www.nevron.com/Forum/Topic4618.aspx

By Bartlomiej Zogala - Wednesday, December 8, 2010

Is it possible to display Text of some business shape factory figure below the figure ? Or what is the best way to implement it, grouping, or connecting some ports of figure and created label?
By Nevron Support - Thursday, December 9, 2010

Hi,

The simplest way to move the text of a shape is to use the Offset property of the shape’s text style. For example: to move the text of a shape below it use the following piece of code:

 

NTextStyle textStyle = new NTextStyle();

textStyle.Offset = new NPointL(0, shape.Height / 2);

NStyle.SetTextStyle(shape, textStyle);

By Volvick Derose 1 - Thursday, December 9, 2010

You can create an additional label for a shape and use the NMargin
to set the position of that label. In this case, you can set the position below the shape


NBoundsLabel myLabel = new NBoundsLabel("my text", myShape.UniqueId, new Nevron.Diagram.NMargins(-4, -4, 11, -4));

//these numbers (-4, -4, 11, -4)); are used for the shape, you can play with your own number to get it right