# InputFormat.UnderlineStyle Property

> 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.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 Windows Forms > Reference > TXTextControl > InputFormat.UnderlineStyle Property
- **787 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underlinestyle-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underlinestyle-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underlinestyle-property/llms-full.txt

---

### 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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underline-property/llms-full.txt) property.

### Syntax

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

```vbnet
Public Property UnderlineStyle 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 XAML example binds the UnderlineStyle property to the selected value of a combo box. The combo box is filled with all supported styles:

```plaintext
<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`.

```csharp
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}");
```

```vbnet
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.

---

## Nearby

- **Previous:** [InputFormat.Underline Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underline-property/llms-full.txt)
- **Next:** [InputFormat.UnderlineStyles Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/underlinestyles-property/llms-full.txt)
