Joboy2k 8 Posted August 10, 2010 Hey guys. This question has already been asked before but as it was like a year ago I wondered if there still was no better way of doing it other than http://www.autoitscript.com/forum/index.php?showtopic=102964&st=0&p=730024&hl=Limit%20characters%20in%20an%20input&fromsearch=1&#entry730024 What I'm aiming to do is create a GUI that takes down credit card details from our customer that call up on the phone. I want to have 4 boxes for the long number on the card. I want each box to have a limit of 4 characters and I want it to automatically move the attention to the next input box. Is there a way of doing this better then how the link solves it? Thanks in advance Share this post Link to post Share on other sites
AlmarM 22 Posted August 10, 2010 You mean like GUICtrlSetLimit ? MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites
Joboy2k 8 Posted August 10, 2010 yes that answers my limiting question thank you, but i need something that will send out a signal when it hits the limit so i can change the focus to the next input box. any ideas? Share this post Link to post Share on other sites
AlmarM 22 Posted August 10, 2010 I tried this, but i'ts not working as is supposed to. #include <GUIConstants.au3> Global $LimiReached = False $GUI = GUICreate("", 500, 500) $Input1 = GUICtrlCreateInput("", 10, 10, 150, 20) $Input2 = GUICtrlCreateInput("", 10, 35, 150, 20) GUICtrlSetLimit($Input1, 10, 0) GUISetState() While Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch If (StringLen(GUICtrlRead($Input1)) = 10 & $LimiReached = False) Then GUICtrlSetState($Input2, $GUI_FOCUS) $LimiReached = True EndIf ConsoleWrite("Length input1: " & StringLen(GUICtrlRead($Input1)) & @CRLF & "Limit reached: " & $LimiReached & @CRLF) ; Weird enough, $LimiReached is set to True without input1 having 10 characters... Weird. WEnd Read my comment btw... MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites