Rex Posted June 7, 2005 Posted June 7, 2005 On my gui i have some input controles. I want to read and validate the contains of them so i have createt a GuiCtrlSetOnEvent for the input but nothing happens when i type / hit enter, how can i work me arount this problem ???? Striped code Opt("GUIOnEventMode", 1) $GUI = GuiCreate("Test", 763, 575,(@DesktopWidth-763)/2, (@DesktopHeight-570)/2 ,$WS_CAPTION+$WS_SYSMENU) $Input_UserName = GuiCtrlCreateInput("User name (Network)", 20, 210, 280, 20) GUICtrlSetTip(-1, "Type the username to conect to the network computer") GUICtrlSetOnEvent($Input_UserName, "UserName") While 1 Sleep(1000) WEnd Func UserName() $Read = GUICtrlRead($Input_UserName) $Crypt = _StringEncrypt ( 1, $Read, "test" ,2 ) IniWrite("Settings.ini", "Network", "UserName", $Crypt) $TEstRead = IniRead(@Scriptdir & "\Settings.ini", "Network", "UserName", "Error") EndFunc
JSThePatriot Posted June 7, 2005 Posted June 7, 2005 I dont think an even can be set for an input control. What you can do though is create a button that reads the input from the input control and decides what do do from there. Or you can probably capture the {ENTER} button while in the input control and have that do something. Just some ideas, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Rex Posted June 7, 2005 Author Posted June 7, 2005 I dont think an even can be set for an input control. What you can do though is create a button that reads the input from the input control and decides what do do from there. Or you can probably capture the {ENTER} button while in the input control and have that do something.Just some ideas,JS<{POST_SNAPBACK}>Hmm i wont create a button corse i already have lots of them on my gui Capture {ENTER} well that could work, but then i have to do a if {ENTER} elseif {TAB} elseif {PRIMARYDOWN} elseif {PRIMARYUP} and to be honest i don't even know how to capture the {ENTER} So it sems that i have to do a Input check on exit, and if some error then throw user a msg, and do a dont exit thing until user correct problem(s)
JSThePatriot Posted June 7, 2005 Posted June 7, 2005 Might consider using GUICtrlGetState() and checking the $GUI_FOCUS and then setting focus using GUICtrlSetState() using $GUI_FOCUS as well. That will have to be in some sort of loop maybe your OnEvent or something. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Rex Posted June 7, 2005 Author Posted June 7, 2005 Might consider using GUICtrlGetState() and checking the $GUI_FOCUS and then setting focus using GUICtrlSetState() using $GUI_FOCUS as well. That will have to be in some sort of loop maybe your OnEvent or something.JS<{POST_SNAPBACK}>Hmm it's hard to be a AutoIt user wannabe but sounds like a lot of work, not that i don't like work - i can se on it for hours For now i thing i just du a on exit check things, if error do something :">
JSThePatriot Posted June 7, 2005 Posted June 7, 2005 I can agree going with the easy way would be best for now. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
blindwig Posted June 8, 2005 Posted June 8, 2005 Hmm i wont create a button corse i already have lots of them on my gui Capture {ENTER} well that could work, but then i have to do a if {ENTER} elseif {TAB} elseif {PRIMARYDOWN} elseif {PRIMARYUP} and to be honest i don't even know how to capture the {ENTER} So it sems that i have to do a Input check on exit, and if some error then throw user a msg, and do a dont exit thing until user correct problem(s) <{POST_SNAPBACK}>Put a button on your form, set it's state to $GUI_DefButton and it will get triggered when you hit Enter. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions
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