iceberg Posted October 24, 2006 Share Posted October 24, 2006 Hi, Let's say I have created a custom GUI. In it I have 2 Input boxes...A and B. Both input boxes can only contain 2 digits. (this part i am able to handle) But what I wish to learn is how do I make it such that once Input box A has fulfilled the criteria for the input, how can it auto tab or "jump" to Input Box B? Thanks alot. Pls help. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 24, 2006 Share Posted October 24, 2006 (edited) Hi,Let's say I have created a custom GUI. In it I have 2 Input boxes...A and B.Both input boxes can only contain 2 digits. (this part i am able to handle)But what I wish to learn is how do I make it such that once Input box A has fulfilled the criteria for the input, how can it auto tab or "jump" to Input Box B?Thanks alot. Pls help.Not quite sure, but I think ControlFocus ( "title", "text", controlID ) may be what you're looking for? Edited October 24, 2006 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
iceberg Posted October 25, 2006 Author Share Posted October 25, 2006 nope, doesn't work. thanks. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2006 Share Posted October 25, 2006 try GuiCtrlSetState with $GUI_FOCUS and there is no Auto Tab so you'll have to determine when to use the GuiCtrlSetState. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2006 Share Posted October 25, 2006 (edited) Here's one method of accomplishing this. expandcollapse popup#include <GuiConstants.au3> Global Const $WM_COMMAND = 0x0111 Global Const $EN_CHANGE = 0x300 Global Const $DebugIt = 1 GUICreate(" My GUI input acceptfile", 320, 120) $input1 = GUICtrlCreateInput("", 10, 5, 300, 20, $ES_NUMBER) GUICtrlSetLimit($input1, 2) $input2 = GUICtrlCreateInput("", 10, 35, 300, 20, $ES_NUMBER) GUICtrlSetLimit($input2, 2) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd Func _Input1_Changed() ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint("Input Changed:" & GUICtrlRead($input1)) ;---------------------------------------------------------------------------------------------- If StringLen(GUICtrlRead($input1)) = 2 Then GUICtrlSetState($input2, $GUI_FOCUS) EndFunc ;==>_Input1_Changed Func _Input2_Changed() ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint("File Changed:" & GUICtrlRead($input2)) ;---------------------------------------------------------------------------------------------- EndFunc ;==>_Input2_Changed Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nNotifyCode = BitShift ($wParam, 16) Local $nID = BitAND($wParam, 0xFFFF) Local $hCtrl = $lParam Switch $nID Case $input1 Switch $nNotifyCode Case $EN_CHANGE _Input1_Changed() EndSwitch Case $input2 Switch $nNotifyCode Case $EN_CHANGE _Input2_Changed() EndSwitch EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND Func _DebugPrint($s_text) $s_text = StringReplace($s_text, @LF, @LF & "-->") ConsoleWrite("!===========================================================" & @LF & _ "+===========================================================" & @LF & _ "-->" & $s_text & @LF & _ "+===========================================================" & @LF) EndFunc ;==>_DebugPrint Edited October 25, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
iceberg Posted October 25, 2006 Author Share Posted October 25, 2006 (edited) thaks gafrost....but got a little error Line 40 (File "Test.au3") Local $nNotifyCode = _HiWord ($wParam) Local $nNotifyCode = ^ ERROR Error: Unknown function name. Edited October 25, 2006 by iceberg mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 25, 2006 Share Posted October 25, 2006 thaks gafrost....but got a little errorLine 40 (File "Test.au3")Local $nNotifyCode = _HiWord ($wParam)Local $nNotifyCode = ^ ERRORError: Unknown function name.copy and paste error on my part, fixed the above post SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
iceberg Posted October 25, 2006 Author Share Posted October 25, 2006 thanks alot. i works magically now... mouse not found....scroll any mouse to continue. 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