Provides a lightweight control for displaying small amounts of text, supporting text wrapping at word boundaries.

Namespace: DigitalRune.Game.UI.Controls
Assembly: DigitalRune.Game.UI (in DigitalRune.Game.UI.dll) Version: 1.1.0.0 (1.1.1.9392)

Syntax

C#
public class TextBlock : UIControl
Visual Basic
Public Class TextBlock _
	Inherits UIControl
Visual C++
public ref class TextBlock : public UIControl

Examples

The following examples shows how to create a button and handle the Click event.
C# Copy imageCopy
var button = new Button
{
  Content = new TextBlock { Text = "Click Me!" },
  Margin = new Vector4F(4),
  Padding = new Vector4F(6),
  HorizontalAlignment = HorizontalAlignment.Stretch,
};

// To show the button, add it to an exising content control or panel.
panel.Children.Add(button);

// To handle button clicks simply add an event handler to the Click event.
button.Click += OnButtonClicked;

Inheritance Hierarchy

System..::..Object
  DigitalRune.Game..::..GameObject
    DigitalRune.Game.UI.Controls..::..UIControl
      DigitalRune.Game.UI.Controls..::..TextBlock

See Also