TX Text Control .NET for Windows Forms

ClientToDocument Method

Method|Introduced in 25.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

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.

public Point ClientToDocument(Point point);
ParameterDescription
point

Specifies a client point which document coordinates are computed.

ClientToDocument(Rectangle)

Computes the specified client rectangle into document coordinates.

public Rectangle ClientToDocument(Rectangle rectangle);
ParameterDescription
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.

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