# TextControl.Selection Property

> Gets or sets the current selection in the text part with the input focus. The property value is an object of the type Web.Selection.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Assembly:** `TXTextControl.Web.dll`, which the TX Text Control .NET Server setup installs, for .NET Framework; in no NuGet package
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > TextControl.Selection Property
- **418 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/selection-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/selection-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/selection-property/llms-full.txt

---

### Description

Gets or sets the current selection in the text part with the input focus. The property value is an object of the type [Web.Selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/llms-full.txt).

### Syntax

```csharp
public TXTextControl.Web.Selection Selection { get; set; }
```

```vbnet
Public Property Selection() As TXTextControl.Web.Selection
```

### Examples

`Selection` belonged to the older server-control surface. In the current ASP.NET Core integration, use `TextControlSettings.TextFieldsEditable` for the corresponding editor configuration.

```csharp
textControlSettings.TextFieldsEditable = true;
if (textControlSettings.TextFieldsEditable)
{
    Console.WriteLine("Text Fields Editable is enabled for Text Control Settings.");
}
```

```vbnet
textControlSettings.TextFieldsEditable = True
If textControlSettings.TextFieldsEditable Then
    Console.WriteLine("Text Fields Editable is enabled for Text Control Settings.")
End If
```

---

## Nearby

- **Previous:** [TextControl.SaveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/savetext-method/llms-full.txt)
- **Next:** [TextControl.ServiceAddress Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/serviceaddress-property/llms-full.txt)
