Underline Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets underlining styles for the selected text.
Syntax
public FontUnderlineStyle Underline { get; set; }Public Property Underline As FontUnderlineStyleMembers
| Value | Description |
|---|---|
| None | Text is not underlined. |
| Single | Text is underlined with a single line. |
| Doubled | Text is underlined with a doubled line. |
| SingleWordsOnly | Only the words of the text are underlined with a single line. |
| DoubledWordsOnly | Only the words of the text are underlined with a doubled line. |
Examples
The following example formats the heading of a short document by using Selection.Underline.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;
selection.Underline = FontUnderlineStyle.DoubledWordsOnly;
Console.WriteLine($"Underline used by Selection: {selection.Underline}");textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection
selection.Underline = FontUnderlineStyle.DoubledWordsOnly
Console.WriteLine($"Underline used by Selection: {selection.Underline}")Limitations
Runtime only.
Remarks
The property's default value is FontUnderlineStyle.None.
The property returns its default value when the text selection contains multiple characters with mixed styles. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.