Jump to content

GUICtrlInput won't allow more characters than can be shown


Graeme
 Share

Recommended Posts

I have created a GUICtrlInput and it works well. My problem is that I wanted to allow for the user to input an addition which would take more characters than the length of the input but would resolve to less characters when the GUI is exited. Like 190000 + 200000+ 30000

I don't want to increase the size of the ctrl input. Is there a way of getting the input to accept more characters? I tried making it multiline and I tried a CtrlEdit but both gave the same problem. It seems that it may be possible to do it if I take off the SS_RIGHT or the ES_ MULTILINE. Is it possible to still have option to go beyond the limit of the input and have SS_RIGHT and ES_ Multiline?

Link to comment
Share on other sites

8 hours ago, Graeme said:

Is there a way of getting the input to accept more characters?

Do you mean something like this ? :

#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>

_Example()

Func _Example()
    Local $idEdit, $sRead, $sFilename

    ; Example : Read GDIPlus.au3 and show the code in an Edit control :
    $sFilename = StringRegExpReplace(@AutoItExe, "(?i)AutoIt3.exe$", "") & "Include\GDIPlus.au3"
    $sRead = FileRead($sFilename)

    GUICreate("Test : Huge Edit Control", 1200, 600)
    $idEdit = GUICtrlCreateEdit("", 2, 2, 1194, 568)

    ; Gets the current text limit for an edit control :
    MsgBox(BitOR(4096, 64), "Info :", "Default Limit : Edit Control (Chars) = " & _GUICtrlEdit_GetLimitText($idEdit) & @CRLF)

    ; Sets a new text limit :
    _GUICtrlEdit_SetLimitText($idEdit, 1500000)
    MsgBox(BitOR(4096, 64), "Info :", "New Limit : Edit Control (Chars) = " & _GUICtrlEdit_GetLimitText($idEdit) & @CRLF)

    GUISetState(@SW_SHOW)
    _GUICtrlEdit_AppendText($idEdit, $sRead)
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Example

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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