Jump to content

Input box limit


brdude
 Share

Recommended Posts

Hi guys I'm new to auto-it and i've been making a script in gui but i have been loking through the forum to see if i found an answer to my question and got nothing (24hr no sleep) :o . Here is my problem i want to creat and input box and limit the # of characters that can be entered and i was wondering if there is a way to script it on auto-it such that when the user is typing and reaches a certain amount of characecters he wont be able to input any thing else to that box. Is there a way to do this or would I have to code it so that when he subimits the form I will have to check the string length and return to the form giving him and error message.

Link to comment
Share on other sites

1

Welcome to the AutoIt Forums

2

A

Yes, GuictrlsetLimit() for a gui ( like you said at the first part of your post

B

you cant test the length after an InputBox with

StringLen()

You can find both of these in help

3

to get everything you need and learn alot fast see this

Welcome to AutoIt 1-2-3

http://www.autoitscript.com/forum/index.php?showtopic=21048#

good luck

8)

NEWHeader1.png

Link to comment
Share on other sites

You can use the following to set the maximum number of characters in an input box. Please note that the current limit is 10. You can change the limit by changing the last 10 to some other number. Hope this is what you are looking for:

InputBox ( "Inputbox", "Please enter something, you can only enter a maximum of 10 characters:" , "", " " & 10)

The Kandie Man :o

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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...