Joboy2k Posted August 10, 2010 Share 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 Link to comment Share on other sites More sharing options...
AlmarM Posted August 10, 2010 Share Posted August 10, 2010 You mean like GUICtrlSetLimit ? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Joboy2k Posted August 10, 2010 Author Share 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? Link to comment Share on other sites More sharing options...
AlmarM Posted August 10, 2010 Share 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... Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now