# AutoSize Constructor

> Initializes a new instance of the AutoSize class. The constructor offers the individual setting of all features.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 11.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 > AutoSize Constructor
- **614 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/constructor/llms-full.txt

---

### Description

Initializes a new instance of the AutoSize class. The constructor offers the individual setting of all features.

### Syntax

#### AutoSize(AutoSizeDirection, AutoSizeDirection, Size, Size)

Initializes a new instance of the AutoSize class. The constructor offers the individual setting of all features.

```csharp
public AutoSize(AutoSizeDirection expand, AutoSizeDirection shrink, Size maxSize, Size minSize);
```

```vbnet
Public Sub New(expand As AutoSizeDirection, shrink As AutoSizeDirection, maxSize As Size, minSize As Size)
```

| Parameter | Description |
|---|---|
| expand | Specifies possible directions for expanding the control. It can be one of the [AutoSizeDirection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosizedirection/enumeration/llms-full.txt) values. |
| shrink | Specifies possible directions for shrinking the control. It can be one of the [AutoSizeDirection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosizedirection/enumeration/llms-full.txt) values. |
| maxSize | Specifies the maximum size, in twips, for expanding the control. |
| minSize | Specifies the minimum size, in twips, for shrinking the control. |

#### AutoSize()

```csharp
public AutoSize();
```

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

### Examples

The following example creates an Auto Size instance and configures its auto expand setting for a document workflow.

```csharp
AutoSize autoSize = new();
autoSize.AutoExpand = AutoSizeDirection.Vertical;
```

```vbnet
Dim autoSize As New AutoSize()
autoSize.AutoExpand = AutoSizeDirection.Vertical
```

---

## Nearby

- **Previous:** [AutoSize.AutoShrink Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/autoshrink-property/llms-full.txt)
- **Next:** [AutoSize.MaxSize Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/maxsize-property/llms-full.txt)
