GuiEditGetMaxLength

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

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

Syntax

int guiEditGetMaxLength ( gui-edit guiEdit )

OOP Syntax Help! I don't understand this!

Method: GuiEdit:getMaxLength(...)
Variable: .maxLength
Counterpart: guiEditSetMaxLength


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 Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI