Show / Hide Table of Contents

# Class Label

Label widget, displays a string at a given position, can include multiple lines.

##### Inheritance

System.Object
Responder
View
Label

##### Inherited Members

Responder.CanFocus
Responder.MouseEvent(MouseEvent)
View.Add(View)
View.Add(View[])
View.AddCh(Int32, Int32, Int32)
View.Bounds
View.ChildNeedsDisplay()
View.Clear()
View.ClearNeedsDisplay()
View.ColorScheme
View.DrawFrame(Rect, Boolean)
View.DrawHotString(String, Boolean, ColorScheme)
View.DrawHotString(String, Attribute, Attribute)
View.Driver
View.EnsureFocus()
View.Focused
View.FocusFirst()
View.FocusLast()
View.FocusNext()
View.FocusPrev()
View.Frame
View.GetEnumerator()
View.HasFocus
View.Id
View.LayoutSubviews()
View.MostFocused
View.Move(Int32, Int32)
View.PositionCursor()
View.ProcessColdKey(KeyEvent)
View.ProcessHotKey(KeyEvent)
View.ProcessKey(KeyEvent)
View.Remove(View)
View.RemoveAll()
View.ScreenToView(Int32, Int32)
View.SetFocus(View)
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.Subviews
View.SuperView
View.ToString()
View.WantMousePositionReports

###### Namespace: Terminal

###### Assembly: Terminal.dll

##### Syntax

    public class Label : Terminal.View

### Constructors

#### Label(Rect, String)

Public constructor: creates a label at the given coordinate with the given string and uses the specified frame for the string.

##### Declaration

    public Label (Terminal.Rect rect, string text);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rect | To be added.
System.String | text | To be added.

#### Label(Int32, Int32, String)

Public constructor: creates a label at the given coordinate with the given string, computes the bounding box based on the size of the string, assumes that the string contains newlines for multiple lines, no special breaking rules are used.

##### Declaration

    public Label (int x, int y, string text);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.
System.String | text | To be added.

### Properties

#### Text

The text displayed by this widget.

##### Declaration

    public virtual string Text { get; set; }

##### Property Value

Type | Description
--- | ---
System.String | To be added.

#### TextAlignment

Controls the text-alignemtn property of the label, changing it will redisplay the label.

##### Declaration

    public Terminal.TextAlignment TextAlignment { get; set; }

##### Property Value

Type | Description
--- | ---
TextAlignment | The text alignment.

#### TextColor

The color used for the label

##### Declaration

    public Terminal.Attribute TextColor { get; set; }

##### Property Value

Type | Description
--- | ---
Attribute | To be added.

### Methods

#### MeasureLines(String, Int32)

Computes the number of lines needed to render the specified text by the Label control

##### Declaration

    public static int MeasureLines (string text, int width);

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text | Text, may contain newlines.
System.Int32 | width | The width for the text.

##### Returns

Type | Description
--- | ---
System.Int32 | Number of lines.

#### Redraw(Rect)

##### Declaration

    public override void Redraw (Terminal.Rect region);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | region | To be added.