Gets or sets a value specifying whether text is underlined at the current input position. The underlining style is determined through the UnderlineStyle property. If text is selected, the property specifies this attribute for the whole selected text.

Syntax

public bool? Underline { get; set; }
Public Property Underline() As Nullable(Of Boolean)

Examples

The following XAML example binds the Underline property to a check box:

<CheckBox
    Height="20"
    Name="checkBoxUnderline"
    IsChecked="{Binding ElementName=textControl1, Path=InputFormat.Underline, Mode=TwoWay}">
    Underline</CheckBox>

Remarks

The property returns null when the text selection contains multiple characters with mixed styles.