Represents a lightweight object for displaying single-line and multi-line multi-formatted text.
| XAML | <TextBlock .../> |
| Scripting | To create an object using scripting, see CreateFromXAML. |
Properties
ActualHeight,
ActualWidth,
Canvas.Left,
Canvas.Top,
Canvas.ZIndex,
Clip,
Cursor,
FontFamily,
FontSize,
FontStretch,
FontStyle,
FontWeight,
Foreground,
Height,
Inlines,
Name,
Opacity,
OpacityMask,
RenderTransform,
RenderTransformOrigin,
Resources,
Text,
TextDecorations,
TextWrapping,
Tag,
Triggers,
Visibility,
Width
Methods
AddEventListener,
CaptureMouse,
Equals,
FindName,
GetHost,
GetParent,
GetValue,
ReleaseMouseCapture,
RemoveEventListener,
SetFontSource,
SetValue
Events
Loaded,
MouseEnter,
MouseLeave,
MouseLeftButtonDown,
MouseLeftButtonUp,
MouseMove
Examples
>The following XAML example shows how to define a TextBlock element and set its Text property to a character string:
| XAML |
<Canvas
xmlns="http://schemas.microsoft.com/client/2007">
<TextBlock Text="Hello, world!" />
</Canvas>
|
The following illustration displays the result of the previous XAML content example.
TextBlock rendering with default font properties
See Also
Text and Fonts Overview
Run
LineBreak