Jump to content

InputBox Help


PieMan
 Share

Recommended Posts

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,

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
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!

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...