youtuber Posted October 15, 2017 Share Posted October 15, 2017 (edited) How high should the problem be to survive? For example, is this limit ideal? 90000000 GUICtrlSetLimit($Edit1, 90000000) or what is the maximum limit? Edited October 15, 2017 by youtuber Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 15, 2017 Moderators Share Posted October 15, 2017 Without any context, how is anyone supposed to help? Why do you feel you need to limit the number of characters? And if you're going to limit the number of characters, why put in the max, as that simply defeats the purpose? Please explain more about what you're trying to do. youtuber 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
youtuber Posted October 15, 2017 Author Share Posted October 15, 2017 To add unlimited data to the edit box Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 15, 2017 Moderators Share Posted October 15, 2017 You're missing the point. If you don't want to limit the characters, then just don't use GUICtrlSetLimit at all. If you search the forum I know the question about control text limits has been asked before, IIRC it was 65,535 bytes for a multi-line. Needless to say they are high enough for someone to add a lot of text without concerns for running out of room. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
kylomas Posted October 16, 2017 Share Posted October 16, 2017 youtuber, Edit controls are one of 5 controls that this function applies to. However, I have curious in the past as to how to use this function with an edit control beyond just setting the limit to an impossible value. @JL - Can you run this code. I'm probably misunderstanding something but this seems to demonstrate that you can affect the limit but not monitor it. #include <String.au3> Local $gui = GUICreate('Limit Test') Local $edit010 = GUICtrlCreateEdit('', 05, 10, 390, 360) GUICtrlSetLimit(-1, 100) Local $status = GUICtrlCreateLabel('', 05, 385, 390, 20) GUISetState() Local $str = _StringRepeat(Chr(Random(65, 90, 1)), 48) & @CRLF, $icnt = 0, $ret = 0 ConsoleWrite(stringlen($str) & @CRLF) While GUIGetMsg() <> -3 $ret = GUICtrlSetData($edit010, $str, 1) If $ret <> 1 Then Exit MsgBox(17, 'Limit Reached', 'Edit control limit = ' & $icnt, 5) GUICtrlSetData($status, $icnt) $icnt += 100 WEnd kylomas youtuber 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
InnI Posted October 16, 2017 Share Posted October 16, 2017 11 hours ago, youtuber said: To add unlimited data to the edit box youtuber 1 Link to comment Share on other sites More sharing options...
kylomas Posted October 16, 2017 Share Posted October 16, 2017 JL, youtuber, Followup...seems the _guictrledit_***limit UDF's might be a work around, will test when I get some time. Thanks Innl... kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
youtuber Posted October 16, 2017 Author Share Posted October 16, 2017 @InnIYeah, I guess that worked GUICtrlSendMsg($Edit1, $EM_LIMITTEXT, -1, 0) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 502, 477, 242, 100) $Edit1 = GUICtrlCreateEdit("" & @CRLF, 32, 48, 201, 353, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") GUICtrlSendMsg($Edit1, $EM_LIMITTEXT, -1, 0) $Edit2 = GUICtrlCreateEdit("" & @CRLF, 248, 48, 225, 353, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("Test", 32, 424, 75, 25) $Label1 = GUICtrlCreateLabel("", 176, 424, 52, 17) GUISetState(@SW_SHOW) Local $lines0 While 1 $lines = ControlCommand($Form1, "", $Edit1, "GetLineCount") If $lines <> $lines0 Then guictrlsetdata($Label1, $lines) $lines0 = $lines EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 For $i = 1 To 10000 Step 1 GUICtrlSetData($Edit1, $i & @CRLF, 1) GUICtrlSetData($Edit2, $i & @CRLF, 1) Next EndSwitch WEnd Spoiler Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now