# Selection.AutoBaseline Property

> Gets or sets values specifying wheather the selected text is automatically sub- or superscripted. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the Baseline property.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 30.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 > Selection.AutoBaseline Property
- **760 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/autobaseline-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/autobaseline-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/autobaseline-property/llms-full.txt

---

### Description

Gets or sets values specifying wheather the selected text is automatically sub- or superscripted. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the [Baseline](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/baseline-property/llms-full.txt) property.

### Syntax

```csharp
public AutoBaseline AutoBaseline { get; set; }
```

```vbnet
Public Property AutoBaseline As AutoBaseline
```

### Members

| Value | Description |
|---|---|
| None | Text is not sub- or superscripted. |
| Superscript | Text is moved above the baseline. |
| Subscript | Text is moved below the baseline. |
| SuperscriptUpperEdge | Text is scaled und moved above the baseline. The moved text does not extend above the upper edge of capital letters. This can be used for nominators of diagonal fractions. |
| SubscriptBaseline | Text is scaled, but is not moved below the baseline. This can be used for denominators of diagonal fractions. |

### Examples

The following example formats the heading of a short document by using `Selection.AutoBaseline`.

```csharp
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

selection.AutoBaseline = AutoBaseline.Superscript;
Console.WriteLine($"Auto Baseline used by Selection: {selection.AutoBaseline}");
```

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection

selection.AutoBaseline = AutoBaseline.Superscript
Console.WriteLine($"Auto Baseline used by Selection: {selection.AutoBaseline}")
```

### Remarks

The property's default value is AutoBaseline.None.

The property returns its default value when the text selection contains multiple characters with mixed settings. The [Selection.IsCommonValueSelected](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/iscommonvalueselected-method/llms-full.txt) method can be used to check for mixed attributes.

---

## Nearby

- **Previous:** [Selection.Attribute Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/attribute-enumeration/llms-full.txt)
- **Next:** [Selection.Baseline Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/baseline-property/llms-full.txt)
