Jump to content
Sign in to follow this  
lampel

moving into next input box without the use of tab key

Recommended Posts

hello all ,

i am a begginer at autoit , 

i have a gui with 18 input boxes ,

for added data input speed is it possible

that when the user input a 3 character long string into one of the input boxes

the curser will auto move to the next input box ,

this is what happens when i press the tab key but i dont want to use it 

what i do today : i enter 3 char data into one of the input boxes, then i press tab to move to the next input box

 

thanks lampel.

 

 

 

Share this post


Link to post
Share on other sites

@lampel you have to decide what criteria tells the script to advance. For example, this snippet will advance once the max number of characters is reached in each input field.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>

    Local $sString = ""
    Local $hGUI = GUICreate("IP Address", 250, 100)
    Local $inpOct1 = GUICtrlCreateInput("", 40, 20, 50, 20)
        GUICtrlSetLimit(-1, 3)
    Local $inpOct2 = GUICtrlCreateInput("", 100, 20, 50, 20)
        GUICtrlSetLimit(-1, 3)
    Local $inpOct3 = GUICtrlCreateInput("", 160, 20, 50, 20)
        GUICtrlSetLimit(-1, 3)
    Local $btnGO = GUICtrlCreateButton("Go", 100, 60, 50, 25)

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $btnGO
                $sString = GUICtrlRead($inpOct1) & "." & GUICtrlRead($inpOct2) & "." & GUICtrlRead($inpOct3)
                MsgBox(0, "IP Address is:", $sString)
        EndSwitch
    WEnd

Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    $nNotifyCode = BitShift($wParam, 16)
    $nID = BitAnd($wParam, 0x0000FFFF)
    Switch $nNotifyCode
        Case $EN_UPDATE
            If StringLen(GUICtrlRead($nID)) = 3 Then GUICtrlSetState($nID+1, $GUI_FOCUS)
    EndSwitch
EndFunc

 


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...