# Shape.FitToCanvas Method

> Expands the shape to the control's canvas size. The method has no effect if the CanFitToCanvas property returns false.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.Drawing`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDrawing.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDrawing.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Drawing > Shape.FitToCanvas Method
- **316 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/fittocanvas-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/fittocanvas-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/fittocanvas-method/llms-full.txt

---

### Description

Expands the [shape](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/llms-full.txt) to the [control](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/llms-full.txt)'s canvas size. The method has no effect if the [CanFitToCanvas](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/canfittocanvas-property/llms-full.txt) property returns false.

### Syntax

```csharp
public void FitToCanvas();
```

```vbnet
Public Sub FitToCanvas()
```

### Examples

The following example uses Fit To Canvas in a focused Shape workflow. The created object is then available to the surrounding document workflow.

```csharp
shape.FitToCanvas();
Console.WriteLine("Shape is ready for use.");
```

```vbnet
shape.FitToCanvas()
Console.WriteLine("Shape is ready for use.")
```

---

## Nearby

- **Previous:** [Shape.Fill.Color Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape-fill/color-property/llms-full.txt)
- **Next:** [Shape.Flip Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/flip-property/llms-full.txt)
