GuiEditGetMaxLength: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0156|1.5.5||This function returns the maximum text length that can be typed within an edit box.}} ==Syntax== <syntaxhighli...")
 
No edit summary
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0156|1.5.5||This function returns the maximum text length that can be typed within an edit box.}}
{{New feature/item|3.0156|1.5.5|13814|This function returns the maximum text length that can be typed within an edit box.}}


==Syntax==  
==Syntax==  

Revision as of 14:04, 25 July 2018

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 Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI