TX Text Control .NET Server

Javascript: TXTextControl.getForeColor Method

Method|Introduced in 28.0

Description

Gets the foreground color of the control which is the color of the document's text.

Syntax

<void> TXTextControl.getForeColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the set foreground color.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TXTextControl.getForeColor in a practical document-editing workflow. It gets the foreground color of the control which is the color of the document's text.

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

TXTextControl.getForeColor(
    function(result) {
        console.log("get fore color result:", result);
    },
    onTxError
);