Jump to content

Recommended Posts

Posted (edited)

#include <GUIConstants.au3>

$gui = GUICreate("My GUI limit input 3 chars")  ; will create a dialog box that when displayed is centered

$input1 = GUICtrlCreateInput("", 10,20)
GUICtrlSetLimit(-1,3)   ; to limit the entry to 3 chars
$input2 = GuiCtrlCreateInput("",10,50)
                
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    if StringLen(GUICtrlRead($input1)) = 3 Then
        ControlClick($gui, "", $input2)
    Endif
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Maby there is a better way, but this is one way.

Edit: build some check in. so he dosn't reactivating the inputbox.

Snappie?

Edited by xzaz
Posted

There is an example floating around that uses an event handler. I think if you look in your AutoIt Includes folder for GUICreateIPAddress there is an example.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...