Sign in to follow this  
Followers 0
Stuempi

How to count the GuiCtrlCreateInput?

4 posts in this topic

Hi there,

another simple question from Mr. Simpleton (me :D ):

How can I count the characters that were input into my GuiCtrlCreateInput?

I tried some things with strings but all to no success... I want to count the characters and give a message box when the characters are below 5 and another one, wenn exactly five were added (because I set the maximum to 5 characters for the input field).

My code looks like this:

$input = GuiCtrlCreateInput("", 125, 210, 50, 20, $ES_UPPERCASE )
GuiCtrlSetLimit($input, 5)

        $test = GuiCtrlRead($input)
        If  $test <= 5 Then
            MsgBox("", "Test", "Test")
        Else
            MsgBox("", "Test", "Test2")
        EndIf

But obviously (again :D ) my script isn't working as intended... any ideas?

Share this post


Link to post
Share on other sites



Hi there,

another simple question from Mr. Simpleton (me :D ):

How can I count the characters that were input into my GuiCtrlCreateInput?

I tried some things with strings but all to no success... I want to count the characters and give a message box when the characters are below 5 and another one, wenn exactly five were added (because I set the maximum to 5 characters for the input field).

My code looks like this:

$input = GuiCtrlCreateInput("", 125, 210, 50, 20, $ES_UPPERCASE )
GuiCtrlSetLimit($input, 5)

        $test = GuiCtrlRead($input)
        If  $test <= 5 Then
            MsgBox("", "Test", "Test")
        Else
            MsgBox("", "Test", "Test2")
        EndIf

But obviously (again :D ) my script isn't working as intended... any ideas?

test = StringLen(GuiCtrlRead($input))

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

StringLen(GuiCtrlRead($input))

Share this post


Link to post
Share on other sites

Thank you both :D

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