GuiMemoGetCaretIndex: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 28: Line 28:
==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
{{GUI_events}}

Revision as of 14:14, 20 May 2018

This function returns the caret (the text cursor) position within the memo box.

Syntax

int guiMemoGetCaretIndex ( element theElement )

Required Arguments

  • theElement: The memo box you want to get the caret position from

Returns

Returns the caret index on success, false otherwise.

Example

This example outputs the caret position of the memo to the chat

local memo = guiCreateMemo(0.4,0.1,0.3,0.3,"",true)

addEventHandler("onClientGUIChanged",memo,function()
	outputChatBox("Caret index is: "..guiMemoGetCaretIndex(memo)) -- output index to chat
end)

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