Sign in to follow this  
Followers 0
PieMan

InputBox Help

5 posts in this topic

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,

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by P5ych0Gigabyte

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by P5ych0Gigabyte

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by P5ych0Gigabyte

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0