# TextControl.ClientToDocument Method

> Computes client coordinates into document coordinates which are in twips relative to the top-left corner of the whole document.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 25.0
- **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.ClientToDocument Method
- **618 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/clienttodocument-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/clienttodocument-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/clienttodocument-method/llms-full.txt

---

### Description

Computes client coordinates into document coordinates which are in twips relative to the top-left corner of the whole document.

### Syntax

#### ClientToDocument(Point)

Computes the specified client point into document coordinates.

```csharp
public Point ClientToDocument(Point point);
```

```vbnet
Public Function ClientToDocument(point As Point) As Point
```

| Parameter | Description |
|---|---|
| point | Specifies a client point which document coordinates are computed. |

#### ClientToDocument(Rectangle)

Computes the specified client rectangle into document coordinates.

```csharp
public Rectangle ClientToDocument(Rectangle rectangle);
```

```vbnet
Public Function ClientToDocument(rectangle As Rectangle) As Rectangle
```

| Parameter | Description |
|---|---|
| rectangle | Specifies a client rectangle which document coordinates are computed. |

### Return Value

The return value specifies the computed document point or rectangle.

### Examples

The following example converts a client-coordinate point to document coordinates.

```csharp
var result = textControl.ClientToDocument(new System.Drawing.Point(20, 20));
Console.WriteLine($"Client To Document result: {result}");
```

```vbnet
Dim result = textControl.ClientToDocument(New System.Drawing.Point(20, 20))
Console.WriteLine($"Client To Document result: {result}")
```

---

## Nearby

- **Previous:** [TextControl.ClearUndo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/clearundo-method/llms-full.txt)
- **Next:** [TextControl.Colors Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol-colors/llms-full.txt)
