TX Text Control .NET for WPF

Underline Property

Property|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets underlining styles for the style.

Syntax

public FontUnderlineStyle Underline { get; set; }

Members

ValueDescription
NoneText is not underlined.
SingleText is underlined with a single line.
DoubledText is underlined with a doubled line.
SingleWordsOnlyOnly the words of the text are underlined with a single line.
DoubledWordsOnlyOnly the words of the text are underlined with a doubled line.

Examples

The following example creates a reusable emphasis style and adds it to the document by using FormattingStyle.Underline.

FormattingStyle formattingStyle = new InlineStyle("Emphasis");

formattingStyle.Underline = FontUnderlineStyle.DoubledWordsOnly;
Console.WriteLine($"Underline used by Formatting Style: {formattingStyle.Underline}");

textControl.InlineStyles.Add((InlineStyle)formattingStyle);

Further Reading