Control the text alignment within the NRichTextLabel control

Applies to: Nevron User Interface for .NET

How to control the text alignment within the NRichTextLabel control?

The text alignment is controlled at two levels. At first place you should use the preferred ContentAlign for the label's item and on the second you should specify the preferred paragraph alignment. The following code illustrates how to align the text in the bottom-right corner of the label and to justify the text within the bounding rect:

[C#]
this.nRichTextLabel.Item.ContentAlign = ContentAlignment.BottomRight;
  
//apply rich text format structure
NRichTextFormat format = NRichTextFormat.Default;
format.ParagraphAlign = ParagraphAlignment.Justify;
this.nRichTextLabel.Item.Style.RichTextFormat = format;

[VB.NET]
Me.nRichTextLabel.Item.ContentAlign = ContentAlignment.BottomRight
  
'apply rich text format structure
Dim format As NRichTextFormat = NRichTextFormat.[Default]
format.ParagraphAlign = ParagraphAlignment.Justify
Me.nRichTextLabel.Item.Style.RichTextFormat = format

Article ID: 87, Created On: 10/11/2010, Modified: 11/16/2010