The NLabel derives indirectly from the NDockPanel class meaning that you can position it at an arbitrary position in the control canvas or dock it to the parent panel. The following code creates a new label at the top left corner of the control:
C# |
Copy Code
|
---|---|
NLabel label = new NLabel(); label.Text = "Hello world"; label.Location = new NPointL(0, 0); label.ContentAlignment = ContentAlignment.BottomRight; label.TextStyle.FontStyle.EmSize = new NLength(22, NGraphicsUnit.Point); chartControl.Panels.Add(label); |
Visual Basic |
Copy Code
|
---|---|
Dim label As New NLabel label.Text = "Hello world" label.Location = New NPointL(0, 0) label.ContentAlignment = ContentAlignment.BottomRight label.TextStyle.FontStyle.EmSize = New NLength(22, NGraphicsUnit.Point) chartControl.Panels.Add(label) |