Nevron Forum

Label of NLineShape

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

By Guido Lauerburg - Thursday, March 17, 2011

Hello,

I am trying to modify an NLineShape's label. Per default, the label's text is on the white background covering the line shape, and is arranged along the line's axis. I want it to be placed below the line, and having a transparent background. Could anyone help me there?

The line is created like this:

messageArrow = new NLineShape();
nDrawingDocument1.ActiveLayer.AddChild(messageArrow);
messageArrow.StyleSheetName = NDR.NameConnectorsStyleSheet;
messageArrow.Text = m.Name;

I tried to manipulate the messageArrow.Labels.DefaultLabel's style, but for no effect...
By Nevron Support - Friday, March 18, 2011

Hi,

To move the text of a line below it you should modify the Offset property of the line shape’s text style. For example:

 

NTextStyle textStyle = (NTextStyle)document.ComposeTextStyle().Clone();

textStyle.Offset = new NPointL(0, 10);

NStyle.SetTextStyle(line1, textStyle);

 

The background of the text is transparent by default, so you do not need to do anything about it. Anyway if you want to modify the background style of the text, use the BacplaneStyle.FillStyle property of the text style.