Andrew Sparkes Posted March 15, 2006 Share Posted March 15, 2006 Let's say I have a grid of input boxes, like shown: ; first row Global $101 = GUICtrlCreateInput("", 24, 32, 25, 21, -1, $WS_EX_CLIENTEDGE) Global $102 = GUICtrlCreateInput("", 56, 32, 25, 21, -1, $WS_EX_CLIENTEDGE) Global $103 = GUICtrlCreateInput("", 88, 32, 25, 21, -1, $WS_EX_CLIENTEDGE) ; second row Global $201 = GUICtrlCreateInput("", 24, 56, 25, 21, -1, $WS_EX_CLIENTEDGE) Global $202 = GUICtrlCreateInput("", 56, 56, 25, 21, -1, $WS_EX_CLIENTEDGE) Global $203 = GUICtrlCreateInput("", 88, 56, 25, 21, -1, $WS_EX_CLIENTEDGE) I want each box to contain only one character, and when it gets that character, to overflow to the next one. Many serial number inputs work this way. Like if I have a serial number, SERIAL123456789,and the box's max lengths were 5. I would start typing it, and when I finished typing the A, it would switch to the next box. I checked the forums and help file, and surprisingly didn't find much. I suppose I could do something like: While 1 If StringLen(GUICtrlRead($101))=1 Then Send('{Tab}') EndIf WEnd But that isn't elegant at all. There must be a way to set the max length on an input and have the overflow go on to the next inputs. Any insight, AutoIt gurus? ---Sparkes. Link to comment Share on other sites More sharing options...
greenmachine Posted March 15, 2006 Share Posted March 15, 2006 Look up GuiCtrlSetLimit in the helpfile. That does what you need. Link to comment Share on other sites More sharing options...
Andrew Sparkes Posted March 15, 2006 Author Share Posted March 15, 2006 Thanks for that, but it will work for only solve half my problem though. l somehow didn't find that function, but oh well, I was only looking at the related functions area and searching. My big problem is the overflow. Once the first box is filled, I want it to automatically move to the next one. Any idea how this can be accomplished? ---Sparkes. Link to comment Share on other sites More sharing options...
CyberSlug Posted March 15, 2006 Share Posted March 15, 2006 I remember Larry (and possibly others) doing something like this:http://www.autoitscript.com/forum/index.ph...topic=20372&hl=Hope that helps Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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