# AutoSize.MaxSize Property

> Gets or sets the maximum size, in pixels, for expanding the control. A control's width or hight cannot be larger than short.MaxValue.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **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.MaxSize Property
- **352 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/maxsize-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/maxsize-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/maxsize-property/llms-full.txt

---

### Description

Gets or sets the maximum size, in pixels, for expanding the control. A control's width or hight cannot be larger than short.MaxValue.

### Syntax

```csharp
public Size MaxSize { get; set; }
```

```vbnet
Public Property MaxSize As Size
```

### Examples

The following example uses `AutoSize.MaxSize` to configure max size as part of the auto size workflow. The configured value is checked before the workflow continues.

```csharp
autoSize.MaxSize = new System.Drawing.Size(600, 400);
Console.WriteLine($"Max Size used by Auto Size: {autoSize.MaxSize}");
```

```vbnet
autoSize.MaxSize = New System.Drawing.Size(600, 400)
Console.WriteLine($"Max Size used by Auto Size: {autoSize.MaxSize}")
```

---

## Nearby

- **Previous:** [AutoSize Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/constructor/llms-full.txt)
- **Next:** [AutoSize.MinSize Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/autosize/minsize-property/llms-full.txt)
