InputPosition Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
Description
An instance of the InputPosition class represents the current text input position of a TXTextControl document.
Syntax
public class InputPositionPublic Class InputPositionExamples
The following example shows how to add a TextField to the document and how to set the input position right after the field.
textControl1.Selection.Text = "Name: ";
TXTextControl.TextField field = new TXTextControl.TextField("%name%");
field.DoubledInputPosition = true;
field.ShowActivated = true;
textControl1.TextFields.Add(field);
textControl1.InputPosition = new TXTextControl.InputPosition(
field.Start + field.Length - 1,
TXTextControl.TextFieldPosition.OutsideTextField);TextControl1.Selection.Text = "Name: "
Dim field As TXTextControl.TextField = New TXTextControl.TextField("%name%")
field.DoubledInputPosition = True
field.ShowActivated = True
TextControl1.TextFields.Add(field)
TextControl1.InputPosition = New TXTextControl.InputPosition( _
field.Start + field.Length - 1, _
TXTextControl.TextFieldPosition.OutsideTextField)The following example examines or changes the insertion point in a short document.
textControl.Text = "Project summary";
InputPosition inputPosition = textControl.InputPosition;textControl.Text = "Project summary"
Dim inputPosition As InputPosition = textControl.InputPositionMembers
Constructors
| Constructor | Description |
|---|---|
| InputPosition | Creates a new instance of the InputPosition class. |
Properties
| Property | Description |
|---|---|
| CaretSize | Gets the size of the caret, in pixels, at the current text input position. |
| Column | Gets the column number of the current text input position. The first column in front of the text is zero. |
| InactiveMarker | Shows or hides a marker which indicates the current text input position when the TextControl is inactive and the blinking caret is not visible. If the property value is true, the marker is shown. |
| Line | Gets the line number of the current text input position. The first line on top of the page is 1. |
| Location | Gets the geometric location of the current text input position. The location is given in twips with an origin at the upper left corner of the document. The relationship between the upper left corner of the document and the upper left corner of the visible portion of the document can be obtained with the TextControl.ScrollLocation property. |
| Page | Gets the page number of the current text input position. This property returns the page number only if the TextControl.ViewMode property has been set to ViewMode.PageView. |
| PageInSection | Gets the page number in the section containing the current text input position. This property returns the page number only if the TextControl.ViewMode property has been set to ViewMode.PageView. |
| Section | Gets the section number of the current text input position. The first section in the document has the number 1. |
| TextPosition | Gets the text position of the current text input position. The first text position of a document is zero. |
Methods
| Method | Description |
|---|---|
| ScrollTo | Scrolls the contents of a Text Control so that the current input position becomes visible. |
Enumerations
| Enumeration | Description |
|---|---|
| ScrollPosition | Determines a position to where the input position is scrolled. |