# ServerTextControl.Selection Property

> Gets or sets the current selection in the main text of the document. The property value is an object of the type Selection. A selection can be used to assign character and paragraph formatting attributes to a piece of text.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 12.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > ServerTextControl.Selection Property
- **406 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/selection-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/selection-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/selection-property/llms-full.txt

---

### Description

Gets or sets the current selection in the main text of the document. The property value is an object of the type [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/llms-full.txt). A selection can be used to assign character and paragraph formatting attributes to a piece of text.

### Syntax

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

```vbnet
Public Property Selection As Selection
```

### Examples

The following example uses the current selection to emphasize a report heading.

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

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, "Quarterly results".Length)
textControl.Selection.Bold = True
```

### Limitations

Runtime only.

---

## Nearby

- **Previous:** [ServerTextControl.SelectAll Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/selectall-method/llms-full.txt)
- **Next:** [ServerTextControl.SelectWord Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/selectword-method/llms-full.txt)
