# TXDrawingControl.SizeToContent Method

> If any changes of the the displayed shapes' visible bounds require an adaption of the TX Drawing Control bounds, the size and/or location of the control is expanded respectively decreased by the considering value of the considering shape's side(s). The method returns an array of doubles which represent the effected alteration for each control's side (left, top, right, bottom) in twips.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.WPF.Drawing`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDrawing.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF.Drawing > TXDrawingControl.SizeToContent Method
- **489 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/sizetocontent-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/sizetocontent-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/sizetocontent-method/llms-full.txt

---

### Description

If any changes of the the displayed [shapes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapes-property/llms-full.txt)' visible bounds [require](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/adaptbounds-event/llms-full.txt) an adaption of the [TX Drawing Control](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/llms-full.txt) bounds, the size and/or location of the control is expanded respectively decreased by the considering value of the considering shape's side(s). The method returns an array of doubles which represent the effected alteration for each control's side (left, top, right, bottom) in twips.

### Syntax

```csharp
public int[] SizeToContent();
```

```vbnet
Public Function SizeToContent() As Integer()
```

### Return Value

An array of doubles which represent the effected alteration for each control's side (left, top, right, bottom) in Twips.

### Examples

The following example uses Size To Content in a focused TXDrawing Control workflow.

```csharp
int[] results = tXDrawingControl.SizeToContent();
foreach (int int32 in results)
{
    Console.WriteLine(int32);
}
```

```vbnet
Dim results As Integer() = tXDrawingControl.SizeToContent()
For Each int32 As Integer In results
    Console.WriteLine(int32)
Next
```

---

## Nearby

- **Previous:** [TXDrawingControl.ShapeSized Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/shapesized-event/llms-full.txt)
- **Next:** [TXDrawingControl.Undo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-drawing/txdrawingcontrol/undo-method/llms-full.txt)
