AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Limiting text box input size

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Anon
Guest





PostPosted: Tue Jun 17, 2008 3:56 pm    Post subject: Limiting text box input size Reply with quote

How can I restrict the amount of characters that a user can enter into a text box?

Gui, Add, Text,, You can type up to three letters here!

Thanks in advance for any help. (i already tried searching Sad )
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Tue Jun 17, 2008 4:03 pm    Post subject: Reply with quote

One cannot type in a text control Smile

You need an Edit control:

Code:
Gui,Add,Edit, h20 w50 Limit3 vMyEdit
Gui,Show
Return


Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1035
Location: switzerland

PostPosted: Tue Jun 17, 2008 4:09 pm    Post subject: Reply with quote

another example, must type in 4 numbers
Code:
;-------------------- INPUT with 4 digits only number with password -------
Gui, Add, Text,, Enter 4 Digit number:
Gui, Add, Edit, vAA1 gAA1 password Number Limit4,
Gui, Add, Button, default disable vButtonOK gPressedOK, OK
Gui, Show
GuiControl, Focus, AA1
GuiControl,Disable,ButtonOK
return

AA1:
  Gui,Submit,NoHide
  If StrLen(AA1) == 4
    GuiControl,Enable,ButtonOK
  Else
    GuiControl,Disable,ButtonOK
  Return


PressedOK:
  gui, submit
  MsgBox %AA1%
  ExitApp
return

GuiClose:
  ExitApp
Back to top
View user's profile Send private message
Anon
Guest





PostPosted: Tue Jun 17, 2008 4:43 pm    Post subject: Reply with quote

thx i used Smile

Gui, Add, Edit, Limit4 vmyname ym
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group