TX Text Control .NET Server

InputPosition Object

Object|Introduced in 28.0

Description

Represents the current text input position of a document.

Syntax

InputPosition

Examples

The following example demonstrates InputPosition in a practical document-editing workflow. It represents the current text input position of a document.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.inputPosition.getCaretSize(
    function(size) {
        if (!size) {
            console.warn("No size was returned.");
            return;
        }
        
        console.log("get caret size result:", size);
    },
    onTxError
);

Members

Methods

MethodDescription
getCaretSizeGets the size of the caret, in pixels, at the current text input position.
getColumnGets the column number of the current text input position.
getInactiveMarkerGets whether the current text input position when the TextControl is inactive and the blinking caret is not visible.
getLineGets the line number of the current text input position.
getLocationGets the geometric location of the current text input position.
getPageGets the page number of the current text input position.
getPageInSectionGets the page number in the section containing the current text input position.
getSectionGets the section number of the current text input position.
getTextPositionGets the text position of the current text input position.
scrollToScrolls the contents of a Text Control so that the current input position becomes visible.
setInactiveMarkerSets whether the current text input position when the TextControl is inactive and the blinking caret is not visible.

Enumerations

EnumerationDescription
ScrollPositionDetermines a position to where the input position is scrolled.