bobbintb Posted October 27, 2009 Posted October 27, 2009 I have a gui and the only thing i cant get to resize is this: $iptext = _GUICtrlEdit_Create($Form1_1, $ipconfig, 350, 16, 385, 550, BitOR($ES_MULTILINE, $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY)) GUICtrlSetState($iptext, $GUI_FOCUS) GUICtrlSetResizing($iptext,$GUI_DOCKAUTO+$GUI_DOCKRIGHT) GUISetState(@SW_SHOW this isnt what the code looked like originally but i tried messing with it and couldnt get it working. let me know if you need the whole script. any ideas?
Moderators Melba23 Posted October 27, 2009 Moderators Posted October 27, 2009 bobbintb,You need to register the WM_MOVE message and then resize your control within the function. Something like this:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #Include <GuiEdit.au3> Global $hGUI = GUICreate("Test", 500, 500, -1, -1, $WS_SIZEBOX) Global $iptext = _GUICtrlEdit_Create($hGUI, "Fred", 10, 10, 480, 480, BitOR($ES_MULTILINE, $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY)) GUICtrlSetState($iptext, $GUI_FOCUS) GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func MY_WM_SIZE($hWnd, $Msg, $wParam, $lParam) Local $iGUIWidth = BitAND($lParam, 0xFFFF) Local $iGUIHeight = BitShift($lParam, 16) ControlMove($hGUI, "", $iptext, Default, Default, $iGUIWidth - 20, $iGUIHeight - 20) Return $GUI_RUNDEFMSG EndFunc;==>MY_WM_SIZEI believe the problem arises because the _GUICtrlEdit_Create function returns a handle and not a ControlID, so GUICtrlSetResizing will not work.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
martin Posted October 28, 2009 Posted October 28, 2009 Yes, the external controls don't respond to the resizing modes. But often you can use the internal controls, get the handle with GuiCtrlGetHandle then you can use that handle for the external functions. For example, I have done this in one script where I wanted resizing to work. Global $Edit1 = GUICtrlCreateEdit("edit 1", 4, 14, $LastWid - 4, $LastHt - 18, $edStyles) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) _GUICtrlEdit_SetMargins(GUICtrlGetHandle($Edit1), $EC_LEFTMARGIN, 2) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
bobbintb Posted October 28, 2009 Author Posted October 28, 2009 oh ok. that makes sense. i always wondered why there were seeming duplicate functions but now i see one works with the handle and the other the controlID. i just switched to a GUICtrlCreateEdit. its working now. thanks for the help.
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