From Bohemia Interactive Community
Revision as of 15:41, 19 June 2021 by Lou Montana (talk | contribs) (Text replacement - "\|s1= +" to "|s1= ")
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Hover & click on the images for description


Selects length characters of edit control from the start position and places cursor at the end of selection.
To move cursor only, set length to 0. To select text from right to left, use negative length (See ctrlTextSelection for more info)
GUI Control


control ctrlSetTextSelection [start, length]
control: Control
[start, length]: Array
start: Number - selection start position
length: Number - length of characters to select (0 to only move the cursor). Negative length will select text from right to left (see example 3)
Return Value:


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]

Additional Information

See also:
ctrlTextSelection ctrlSetText


Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note