GuiMemoSetCaretIndex

From Multi Theft Auto: Wiki
Revision as of 13:54, 10 August 2021 by Pawelo (talk | contribs) (Add missing OOP info)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function sets the current position of the caret (the text cursor) within the memo.

Syntax

bool guiMemoSetCaretIndex ( gui-memo theMemo, int index )

OOP Syntax Help! I don't understand this!

Method: GuiMemo:setCaretIndex(...)
Variable: .caretIndex
Counterpart: guiMemoGetCaretIndex


Required Arguments

  • theMemo: The memo edit box where the caret position is to be changed.
  • index: An integer referring to the desired character position within the box. 0 would be before the first character in the box, 1 before the second, etc.

Returns

Returns true if the caret was successfully moved, false otherwise.

Example

This example would create a memo and set the caret before the "H" in "Hi".

local memo = guiCreateMemo(100,100,200,100,"Hi",false)
guiMemoSetCaretIndex(memo,0)--sets the caret before H

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI