 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Anon Guest
|
Posted: Tue Jun 17, 2008 3:56 pm Post subject: Limiting text box input size |
|
|
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 ) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5890
|
Posted: Tue Jun 17, 2008 4:03 pm Post subject: |
|
|
One cannot type in a text control
You need an Edit control:
| Code: | Gui,Add,Edit, h20 w50 Limit3 vMyEdit
Gui,Show
Return |
 _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1035 Location: switzerland
|
Posted: Tue Jun 17, 2008 4:09 pm Post subject: |
|
|
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 |
|
 |
Anon Guest
|
Posted: Tue Jun 17, 2008 4:43 pm Post subject: |
|
|
thx i used
Gui, Add, Edit, Limit4 vmyname ym |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|