Code: Select all
#SingleInstance Ignore
Gui, Add, Edit, x10 y10 w150 limit4 gGetCount vedtType
Gui, Add, Text, x10 y+10 w150 vtxtCount
Gui, Show, Center
Return
GetCount:
GuiControlGet, myString,, edtType
nowCount := StrLen(myString)
GuiControl,, txtCount, %nowCount%/4
Return
ESC::
GuiClose:
ExitApp
Return
Code: Select all
#SingleInstance Ignore
SetKeyDelay, -1, -1
Gui, Add, Edit, x10 y10 w150 gGetCount vedtType
Gui, Add, Text, x10 y+10 w150 vtxtCount
Gui, Show, Center
Return
GetCount:
GuiControlGet, myString,, edtType
nowCount := StrLen(myString)
GuiControl,, txtCount, %nowCount%/4
If nowCount > 4
ControlSend, Edit1, {BackSpace}
Return
ESC::
GuiClose:
ExitApp
Return