Sign in to follow this  
Followers 0
cgycowboy

Characters remaining?

5 posts in this topic

#1 ·  Posted (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 by cgycowboy

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#Include <GuiEdit.au3>

_GUICtrlEdit_SetLimitText($hWnd, $iLimit)

? help file ?

Thanks for your help. I meant the included SCITE help

Share this post


Link to post
Share on other sites

Lol, use the AutoIT help file then it might be more useful :D, 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.

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