# TextControl Constructor

> Initializes a new instance of the TextControl class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl Constructor
- **362 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/constructor/llms-full.txt

---

### Description

Initializes a new instance of the TextControl class.

### Syntax

```csharp
public TextControl();
```

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

### Examples

The following example creates a dock-filled Windows Forms editor and adds it to a form.

```csharp
System.Windows.Forms.Form form = new();
TextControl textControl = new() { Dock = System.Windows.Forms.DockStyle.Fill };
form.Controls.Add(textControl);
```

```vbnet
Dim form As New System.Windows.Forms.Form()
Dim textControl As New TextControl() With { .Dock = System.Windows.Forms.DockStyle.Fill }
form.Controls.Add(textControl)
```

---

## Nearby

- **Previous:** [TextControl.ConditionalInstructionDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/conditionalinstructiondialog-method/llms-full.txt)
- **Next:** [TextControl.ContentsReset Event](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/contentsreset-event/llms-full.txt)
