Limits the number of characters/pixels for a control.
GUICtrlSetLimit ( controlID, max [, min] )
| controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function. |
| max | For List controls it is the extent you can scroll horizontally in pixels. For Input/Edit controls it is the max number of characters that can be entered. |
| min | [optional] For Slider and UpDown controls you can specify a min value. Default = 0 |
| Success: | Returns 1. |
| Failure: | Returns 0. |
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $msg
GUICreate("My GUI limit input 3 chars") ; will create a dialog box that when displayed is centered
GUICtrlCreateInput("", 10, 20)
GUICtrlSetLimit(-1, 3) ; to limit the entry to 3 chars
GUISetState()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example