# FormattingStyle.Underline Property

> Gets or sets underlining styles for the style.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 10.1
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > FormattingStyle.Underline Property
- **542 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/underline-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/underline-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/underline-property/llms-full.txt

---

### Description

Gets or sets underlining styles for the style.

### Syntax

```csharp
public FontUnderlineStyle Underline { get; set; }
```

```vbnet
Public Property Underline As FontUnderlineStyle
```

### Members

| 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 creates a reusable emphasis style and adds it to the document by using `FormattingStyle.Underline`.

```csharp
FormattingStyle formattingStyle = new InlineStyle("Emphasis");

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

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

```vbnet
Dim formattingStyle As FormattingStyle = New InlineStyle("Emphasis")

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

textControl.InlineStyles.Add(DirectCast(formattingStyle, InlineStyle))
```

---

## Nearby

- **Previous:** [FormattingStyle.TextBackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/textbackcolor-property/llms-full.txt)
- **Next:** [FormattingStyleCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstylecollection/llms-full.txt)
