GuiEditGetMaxLength

From Multi Theft Auto: Wiki
Jump to: navigation, search

This function returns the maximum text length that can be typed within an edit box.

Syntax

int guiEditGetMaxLength ( gui-edit guiEdit )

Required Arguments

  • guiEdit: The edit box you want to get the maximum text length of.

Returns

Returns the maximum text length on success, false otherwise.

Example

This example outputs the maximum text length of an edit field to the chat.

local edit = guiCreateEdit( 0.4, 0.4, 0.3, 0.1, "", true )

addEventHandler( "onClientGUIChanged", edit,
    function( )
        outputChatBox( "Characters remaining in edit box: " .. guiEditGetMaxLength( source ) - #guiGetText( source ) ) -- output remaining amount of characters
    end
)

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Fields

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

GUI events