PcExpert Posted January 7, 2008 Share Posted January 7, 2008 Hi all, How to limit the amount of characters that can be entered in an GUIctrlcreateinput() Control? Thanks! Link to comment Share on other sites More sharing options...
xzaz Posted January 7, 2008 Share Posted January 7, 2008 GUICtrlSetLimit() Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
PcExpert Posted January 7, 2008 Author Share Posted January 7, 2008 Thanks! Does somebody know how to move the cursor to the next input when the limit is reached? Link to comment Share on other sites More sharing options...
xzaz Posted January 7, 2008 Share Posted January 7, 2008 (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 January 7, 2008 by xzaz Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
weaponx Posted January 7, 2008 Share Posted January 7, 2008 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. 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