PieMan Posted October 22, 2009 Posted October 22, 2009 I got a quick question with Input Boxes. I would like to restrict the user from typing any numbers in the input box but allow Alphabetical characters and white space. Is there something like: $ES_NUMBER I can use? Thanks,
FuryCell Posted October 22, 2009 Posted October 22, 2009 (edited) I dont believe it is as easy as $ES_NUMBER but you could add a function to the inputbox that checks the characters. Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
FuryCell Posted October 22, 2009 Posted October 22, 2009 (edited) Here is a nice little example I wrote. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 251, 80, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 32, 24, 169, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $Read=GuiCtrlRead($Input1) For $X=StringLen($Read) to 1 step -1 $Char=StringMid($Read,$X,1) If Not (StringIsAlpha($Char) or $Char=" ") then GuiCtrlSetData($Input1,StringLeft($Read,$X-1)) Next WEnd Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
PieMan Posted October 22, 2009 Author Posted October 22, 2009 Thanks for the example, It doesn't exactly work the way I like too but you have just given my another idea with your example code. Thanks for the inspiration and your help!
FuryCell Posted October 22, 2009 Posted October 22, 2009 (edited) Thanks for the example, It doesn't exactly work the way I like too but you have just given my another idea with your example code. Thanks for the inspiration and your help!Your Welcome. When you get it working would mind sharing your idea? I'm interested to see what you come up with. Edited October 22, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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