cgycowboy Posted January 28, 2010 Share Posted January 28, 2010 (edited) If I would like to limit the amount of text in an edit box to say....255 characters. What code would I use? I have searched through help and found nothing.. Thanks in advance #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Issue", 615, 222, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $Label1 = GUICtrlCreateLabel("Please Describe The Customer's Issue For The Technician", 88, 0, 416, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Edit1 = GUICtrlCreateEdit("", 16, 32, 577, 113, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "") GUICtrlSetResizing(-1, $GUI_DOCKHCENTER) $Button1 = GUICtrlCreateButton("OK", 240, 160, 105, 33, 0) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) Func Button1Click() ;~ * MsgBox(0, "", $Edit1 ) Exit EndFunc Func CLOSEClicked() Exit EndFunc While 1 Sleep(100) WEnd MsgBox(0,"edit box messages go here limiting to 250 characters","") Edited January 28, 2010 by cgycowboy Link to comment Share on other sites More sharing options...
furrycow Posted January 28, 2010 Share Posted January 28, 2010 (edited) _GUICtrlEdit_SetLimitText($EditHandle,255) Edited January 28, 2010 by furrycow Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
FaT3oYCG Posted January 28, 2010 Share Posted January 28, 2010 #Include <GuiEdit.au3> _GUICtrlEdit_SetLimitText($hWnd, $iLimit) ? help file ? Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
cgycowboy Posted January 28, 2010 Author Share Posted January 28, 2010 #Include <GuiEdit.au3>_GUICtrlEdit_SetLimitText($hWnd, $iLimit)? help file ?Thanks for your help. I meant the included SCITE help Link to comment Share on other sites More sharing options...
FaT3oYCG Posted January 28, 2010 Share Posted January 28, 2010 Lol, use the AutoIT help file then it might be more useful , the Scite help file won't list anything about AutoIT in it's helpfile as it has nothing to do with it (the Scite help file that is). Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. 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