Arma 3 Scripting

ctrlSetTextSelection

  • Arma 3 v2.00

Command · Markdown · JSON · original wiki page

Description

Selects length characters of edit control from the start position and places cursor at the end of selection.

Note

To only move the cursor, set length to 0. To select text from right to left, use negative length (See ctrlTextSelection for more info)

Syntax

control ctrlSetTextSelection [start, length]

Parameters:

Returns: Nothing

Examples

Example 1

_control ctrlSetTextSelection [5, 10];

Example 2

disableSerialization;
private _ctrl = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscEditMulti", -1];
_ctrl ctrlSetPosition [0,0,0.5,0.3];
_ctrl ctrlCommit 0;
_ctrl ctrlSetText "Hello World";
_ctrl ctrlSetTextSelection [6, 5]; // selects World
ctrlSetFocus _ctrl;

Example 3

Select text from right to left:

_control ctrlSetTextSelection [5, -4];

See also

ctrlTextSelection · ctrlSetText