UnderlineStyle Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets the underline style at the current input position. If text is selected, the property specifies this attribute for the whole selected text. This property determines the style for the Underline property.
Syntax
public FontUnderlineStyle UnderlineStyle { get; set; }Public Property UnderlineStyle 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 XAML example binds the UnderlineStyle property to the selected value of a combo box. The combo box is filled with all supported styles:
<ComboBox
Height="24"
Name="comboboxUnderlineStyle"
ItemsSource="{Binding ElementName=textControl1, Path=InputFormat.UnderlineStyles, Mode=OneTime}"
SelectedValue="{Binding ElementName=textControl1, Path=InputFormat.UnderlineStyle, Mode=TwoWay}"/>The following example changes the formatting applied to text entered at the end of a document by using InputFormat.UnderlineStyle.
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;
inputFormat.UnderlineStyle = FontUnderlineStyle.DoubledWordsOnly;
Console.WriteLine($"Underline Style used by Input Format: {inputFormat.UnderlineStyle}");textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat
inputFormat.UnderlineStyle = FontUnderlineStyle.DoubledWordsOnly
Console.WriteLine($"Underline Style used by Input Format: {inputFormat.UnderlineStyle}")Remarks
The property's default value is FontUnderlineStyle.Single.
The property returns FontUnderlineStyle.None, if the text selection has no common underline style.