Newbie here, so possibly stupid question...:
Can almost do what I want to with InputBox, but trying to do the same
with GUICtrlCreateInput()...: I want to create a GUI with an input field.
The user can only enter something and press enter, or kill the window
with the little x in the upper right corner. I don't want an 'Ok' button, I
want 'Enter' to be all the user has to do. Here is what I have:
#include <GuiConstants.au3>
Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
$mainwindow = GUICreate("Title Goes Here", 400, 200)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GuiCtrlCreateLabel("Please Enter:", 150, 20)
$card=GuiCtrlCreateInput("", 130, 50, 130, 20)
GUICtrlSetOnEvent($card, "ScanComplete")
GUISetState(@SW_SHOW)
While 1
Sleep(1000) ; Idle around
WEnd
Func ScanComplete()
MsgBox(0, "GUI Event", "It works!")
EndFunc
Func CLOSEClicked()
MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
Exit
EndFunc
The problem is, ScanComplete is never called on any keys, Enter, TAB, nothing
makes it go. If you click on the thing to minimize the window, then it is called, but
I think only if the input field changed.
How do I make it terminate on 'Enter'?
Thanks....