Text Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets a string containing the currently selected text.
Syntax
public string Text { get; set; }Public Property Text As StringExamples
The following example formats the heading of a short document by using Selection.Text.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;
selection.Text = "Quarterly results";
if (!string.IsNullOrWhiteSpace(selection.Text))
{
Console.WriteLine($"Text: {selection.Text}");
}textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection
selection.Text = "Quarterly results"
If Not String.IsNullOrWhiteSpace(selection.Text) Then
Console.WriteLine($"Text: {selection.Text}")
End IfLimitations
Runtime only.