wyzzard Posted August 31, 2012 Share Posted August 31, 2012 (edited) I'm working on a GUI to get inventory codes to order and I have something that works okay but you have to hit the TAB key to move from box to box. Since all the boxes have to have numbers it would be nice if they could hit the ENTER key on the NUMPAD and it would go to next box as well. Here's the GUI snippet of what I have so far - expandcollapse popup#include <String.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> HotKeySet("{ESC}", "Terminate") $frmOrder = GUICreate("Items Needed", 460, 450, -1, -1) GUISetFont(12, 800, 0, "MS Sans Serif") $butIssue = GUICtrlCreateButton("Issue", 70, 370, 80, 50) $butXFER = GUICtrlCreateButton("Transfer", 190, 370, 80, 50) $butCancel = GUICtrlCreateButton("Cancel", 310, 370, 80, 50) $lblJob = GUICtrlCreateLabel(" Job #", 55, 35, 100, 28) $lblPSID = GUICtrlCreateLabel(" PSID", 180, 35, 100, 28) $lblQty = GUICtrlCreateLabel(" Quantity", 305, 35, 100, 28) $chkRush = GUICtrlCreateCheckbox("", 195, 315, 17, 28) GUICtrlSetState(-1, $GUI_UNCHECKED) $lblRush = GUICtrlCreateLabel("RUSH", 215, 318, 75, 28) GUICtrlSetColor(-1, 0xeb0f0f) ; Red Local $arrInputBox [5] [4] Local $arrLineLabel [5] Global $intActiveSet = 0 For $intSet = 0 To 4 $arrLineLabel [$intSet] =GUICtrlCreateLabel($intSet + 1, 25, 65 + (50 * $intSet), 15, 28) For $intPart = 0 to 2 $arrInputBox [$intSet] [$intPart] = GUICtrlCreateInput("", 55 + (125 * $intPart), 65 + (50 * $intSet), 100, 28, $ES_NUMBER) If $intSet > 0 Then GUICtrlSetState($arrInputBox [$intSet] [$intPart], $GUI_DISABLE) EndIf Next Next GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func WM_COMMAND($hWinHandle, $iMsg, $wParam, $lParam) If _WinAPI_HiWord($wParam) = $EN_CHANGE Then If $intActiveSet > 0 Then If (GUICtrlRead($arrInputBox [$intActiveSet] [0]) = "" And GUICtrlRead($arrInputBox [$intActiveSet] [1]) = "" And GUICtrlRead($arrInputBox [$intActiveSet] [2]) = "") And (GUICtrlRead($arrInputBox [$intActiveSet-1] [0]) = "" Or GUICtrlRead($arrInputBox [$intActiveSet] [1]) = "" Or GUICtrlRead($arrInputBox [$intActiveSet] [2]) = "") Then For $intStep = 0 To 2 GUICtrlSetState($arrInputBox [$intActiveSet] [$intStep],$GUI_DISABLE) Next $intActiveSet -= 1 EndIf EndIf If (GUICtrlRead($arrInputBox [$intActiveSet] [0]) <> "" And GUICtrlRead($arrInputBox [$intActiveSet] [1]) <> "" And GUICtrlRead($arrInputBox [$intActiveSet] [2]) <> "") Then If $intActiveSet < 4 Then $intActiveSet += 1 For $intStep = 0 To 2 GUICtrlSetState($arrInputBox [$intActiveSet] [$intStep],$GUI_ENABLE) Next EndIf EndIf EndIf EndFunc ;==>WM_COMMAND While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Terminate() Case $butCancel Terminate() EndSwitch WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate I found the WM_COMMAND function on the forum here to help me figure out part of what I was doing to prevent the next row of boxes being enabled until the top is filled in but haven't quite figured out how to capture the ENTER key input to make it move the focus to the next control. Any suggestions? Edited September 1, 2012 by wyzzard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 31, 2012 Moderators Share Posted August 31, 2012 wyzzard, how to capture the ENTER key input to make it move the focus to the next controlYou should find the answer in this post. Please ask if you have any questions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wyzzard Posted September 1, 2012 Author Share Posted September 1, 2012 That's exactly what I needed. Thanks I've found lots of useful tidbits when I do searches in the forum but I still have trouble actually finding what I really was looking for. Haven't quite figured out what the best search terms to use yet for a given need. Link to comment Share on other sites More sharing options...
wyzzard Posted September 1, 2012 Author Share Posted September 1, 2012 One more quick question - How do I edit the topic heading so I can put [sOLVED] in it? I've seen other topics where this is done but haven't found a way to edit it myself unless I'm missing the obvious.This will let others looking for something similar know that an answer is contained within. Thanks again for the help Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2012 Moderators Share Posted September 1, 2012 wyzzard, Haven't quite figured out what the best search terms to use yet for a given needNeither have I - but I do have a good memory and a lot of my own posts to use as a basis for searching. How do I edit the topic heading so I can put [sOLVED] in it?I take it a "+solved +title +add" search did not work for you? Edit the first post of the thread and select the "Use Full Editor" option - then you can edit the title as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wyzzard Posted September 1, 2012 Author Share Posted September 1, 2012 I didn't actually search about the [solved] question because I thought I had read somewhere that you couldn't change it until you had some unknown number of posts made... and since the default posting interface did everything I was needing to do I never thought to click on the option probably would help more if I wasn't perusing these forums in the wee hours of the morning here most of the time when I'm not fully awake Thanks again 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