How validate with the enter key?
Posted: Thu Jul 06, 2023 1:03 pm
Hello,
Do yo know how to validate a stringadget with the enter(rc) key ?
Cordially
Do yo know how to validate a stringadget with the enter(rc) key ?
Cordially
- a basic to master the web -
https://forums.spiderbasic.com/
Code: Select all
Enumeration
#Window
#StringGadget
#PB_Shortcut_Return_Event
EndEnumeration
Procedure MenuEvents()
If EventMenu() = #PB_Shortcut_Return_Event
If GetActiveGadget() = #StringGadget
Debug "Gotcha!"
EndIf
EndIf
EndProcedure
OpenWindow(#Window, 0, 0, 320, 260, "Shortcut", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(#StringGadget, 10, 10, 300, 30, "")
AddKeyboardShortcut(0, #PB_Shortcut_Return, #PB_Shortcut_Return_Event)
BindEvent(#PB_Event_Menu, @MenuEvents())
SetActiveGadget(#StringGadget)