Hyflex Posted March 20, 2012 Share Posted March 20, 2012 (edited) Hey, I've got a few things what I'm trying to do but I have no idea how to do them... Here is part of my code $StatusBar = _GUICtrlStatusBar_Create($PostMe) _GUICtrlStatusBar_SetMinHeight($StatusBar, 20) $Button_PAll = GUICtrlCreateButton("PAll", 5, 330, 433, 50) $Edit_TextToPost = GUICtrlCreateEdit("", 10, 10, 425, 315, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_BORDER)) GUICtrlSetData(-1, "") GUICtrlSetLimit($Edit_TextToPost,1244) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 ;_GUICtrlStatusBar_SetText($StatusBar, ) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm trying to add a counter which counts down from 1244 characters, every time a character is added to the Edit box and for it to auto-update using the status bar so if I was to have the word: "dog" in the edit box the status bar would appear: Characters left: 1241 I also have an issue with the status bar not being "constrained"/wordwrapped if I type loads it just goes off to the right, I want it to move down move down instead of this happening where it goes on and on and on and on and on and onit would look like this where it goes to the next line after as soon as it hits the edge of the box Any help would be greatly appreciated. I've got a awful headache trying to work this out but nothing has worked. Edited March 20, 2012 by XxXGoD Link to comment Share on other sites More sharing options...
LarsJ Posted March 25, 2012 Share Posted March 25, 2012 Try this #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> $chars = 200 $hGui = GUICreate( "Edit", 445, 365, 590, 200 ) $idEdit = GUICtrlCreateEdit("", 10, 10, 425, 315, $ES_WANTRETURN) $hEdit = GUICtrlGetHandle( $idEdit ) GUICtrlSetLimit($idEdit,$chars) $label = GUICtrlCreateLabel ( $chars, 10, 335, 50, 20 ) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low word $iCode = BitShift($iwParam, 16) ; High word Switch $hWndFrom Case $hEdit Switch $iCode Case $EN_CHANGE $textLen = StringLen( GUICtrlRead( $idEdit ) ) $charsLeft = $chars - $textLen GUICtrlSetData( $label, $charsLeft ) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions 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