# Selection Constructor

> Creates a new instance of the Web.Selection class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Package:** `TXTextControl.Web` (assembly `TXTextControl.Web.DocumentEditor.dll`, from nuget.org, the private NuGet feed or Text Control Offline Packages)
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > Selection Constructor
- **549 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/constructor/llms-full.txt

---

### Description

Creates a new instance of the [Web.Selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/llms-full.txt) class.

### Syntax

#### Selection()

Creates an empty Selection object with all properties set to their default values.

```csharp
public Selection();
```

```vbnet
Public Sub New()
```

#### Selection(int, int)

Creates an instance of the [Web.Selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/llms-full.txt) class with the specified start value and length.

```csharp
public Selection(int start, int length);
```

```vbnet
Public Sub New(start As Integer, length As Integer)
```

| Parameter | Description |
|---|---|
| start | Specifies the selection's start position. |
| length | Specifies the number of selected characters. |

### Examples

The following example creates a Selection instance and verifies that it is ready for the surrounding document workflow.

```csharp
TXTextControl.Web.Selection selection = new();
Console.WriteLine("Selection is ready.");
```

```vbnet
Dim selection As New TXTextControl.Web.Selection()
Console.WriteLine("Selection is ready.")
```

---

## Nearby

- **Previous:** [Selection Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/llms-full.txt)
- **Next:** [Selection.Length Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/length-property/llms-full.txt)
