Sign in to follow this  
Followers 0
nullschritt

Text Input Limit

6 posts in this topic

Hello, it's been a while since I've coded at all.

I decided to finish up an old project of mine, so i went ahead and installed thew newest autoit and beta and ISN.

I got my project working as expected, all but one problem. The text inputs for the username and password only seem to allow a certain number of characters, after I hit the limit the program just goes "ding" as if to let me know I can't type any more.

Does anyone know why I'm having this problem?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You say "text inputs", in what type of control (GUI, InputBox, MsgBox?)? How about showing us some code that gives example of the problem, rather than asking us to guess?

 

Edit: On a GUI Input, for example, I can get in many hundreds of characters, depending on the size I make the control. A running example of your code will help us help you.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

guictrlcreateinput() Here go:

Func _logingui()
        Global $login = GUICreate("Secure Instant Messenger", 640, 395, -1, -1, $ws_popup + $ws_caption + $ws_ex_clientedge + $ws_popupwindow + $ws_visible, -1)
        $filexx = GUICtrlCreateMenu("&File")
        $exitx = GUICtrlCreateMenuItem("&Exit", $filexx)
        GUICtrlSetOnEvent($exitx, "_exit")
        $helpxx = GUICtrlCreateMenu("&Help")
        $hf = GUICtrlCreateMenuItem("&Help File", $helpxx)
        $hf = GUICtrlCreateMenuItem("&Privacy Policy", $helpxx)
        $hf = GUICtrlCreateMenuItem("&Terms Of Service", $helpxx)
        GUISetBkColor(16777215, $login)
        GUISetIcon("images\main.ico")
        GUISetOnEvent($gui_event_close, "_exit")
        GUICtrlCreatePic("Images\logo.jpg", 104, -7, 432, 105, -1, -1)
        GUICtrlCreatePic("Images\35644.jpg", 162, 85, 308, 290, -1, -1)
        Global $uid = GUICtrlCreateInput("", 14, 165, 150, 25, 1, 544)
        GUICtrlSetFont(-1, 12, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlSetTip(-1, "Enter your User ID here.")
        Global $pwd = GUICtrlCreateInput("", 14, 238, 150, 25, 32, 544)
        GUICtrlSetFont(-1, 12, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlSetTip(-1, "Enter your password here.")
        GUICtrlCreateGroup("Sign In", 4, 113, 177, 238, -1, -1)
        GUICtrlSetFont(-1, 16, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreateLabel("Password", 40, 218, 100, 20, 1, -1)
        GUICtrlSetFont(-1, 12, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreateLabel("User ID", 40, 145, 100, 20, 1, -1)
        GUICtrlSetFont(-1, 12, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreateCheckbox("REMEMBER", 44, 263, 102, 20, -1, -1)
        GUICtrlSetFont(-1, 10, 300, 0, "District")
        GUICtrlSetBkColor(-1, "0xFFFFFF")
        GUICtrlCreateCheckbox("Remember", 44, 189, 102, 20, -1, -1)
        GUICtrlSetFont(-1, 10, 300, 0, "District")
        GUICtrlSetBkColor(-1, "0xFFFFFF")
        Global $signinbutton = GUICtrlCreateButton("Sign In", 40, 303, 100, 25, -1, -1)
        GUICtrlSetOnEvent(-1, "_login")
        GUICtrlSetFont(-1, 14, 400, 0, "District")
        GUICtrlCreateGroup("News", 455, 113, 180, 238, -1, -1)
        GUICtrlSetFont(-1, 16, 400, 0, "District")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreateEdit("Recent News:" & @CRLF & _inetgetsource("https://prodynamics.co/link.php?CMD=page&ID=SIMNEWSTXT"), 462, 140, 168, 205, $es_autovscroll + $ws_vscroll, -1)
        GUICtrlSetFont(-1, 12, 400, 0, "Impact")
        GUICtrlCreateLabel($version, 240, 190, 160, 50, 1, -1)
        GUICtrlSetFont(-1, 35, 400, 0, "Impact")
        GUICtrlSetColor(-1, "0x808080")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreateLabel("Register", 68, 331, 140, 15, -1, -1)
        GUICtrlSetOnEvent(-1, "_registergui")
        GUICtrlSetFont(-1, 10, 700, 0, "Times New Roman")
        GUICtrlSetColor(-1, "0x0000FF")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlSetBkColor(-1, "-2")
        GUICtrlCreatePic("Images\qr.jpg", 579, -2, 62, 62, -1, -1)
        GUICtrlCreatePic("Images\PD.jpg", 1, 1, 100, 80, -1, -1)
        GUICtrlSetFont(-1, 12, 400, 0, "Impact")
        GUICtrlSetBkColor(-1, "-2")
        GUISetState(@SW_SHOW, $login)
    EndFunc
Edited by nullschritt

Share this post


Link to post
Share on other sites

Look at GUICtrlSetLimit in the help file.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Look at GUICtrlSetLimit in the help file.

Tried the following:

Global $pwd = GUICtrlCreateInput("", 14, 238, 150, 25, 32, 544)
        GUICtrlSetLimit(-1,500)

Same results. The input is limited to 14 characters, which is the exact width of the control, it won't let me type anything "longer" then the control.

Share this post


Link to post
Share on other sites

Fixed: Needed to add autohscroll.

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