corgano Posted June 10, 2017 Share Posted June 10, 2017 (edited) If I create a window that has $WS_SIZEBOX style, I set up docking on the controls, and I click and drag it the controls stay inside the window correctly. If I take the SAME window, and I use WinMove() to change it's size, none of the control sizes / positions update. How can I update my window after the WinMove() so autoit sees it changed size and repositions the controls?SOLUTION: Put the winMove() AFTER you winSetState() to make the window visible! Edited June 13, 2017 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 11, 2017 Moderators Share Posted June 11, 2017 @corgano almost 1000 posts you should know to provide your code, or a reproducer, rather than expect someone to guess at exactly what you're doing in your GUI and then troubleshoot for you. Help us help you. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
corgano Posted June 13, 2017 Author Share Posted June 13, 2017 (edited) I thought it'd be simple enough an example wasn't needed, here is the example from the help file, with the winmove added: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() Opt("GUICoordMode", 2) $gui = GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; start the definition GUISetFont(8, -1, "Arial") GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP) Local $idEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ; add the input area GUICtrlSetState($idEdit, $GUI_FOCUS) GUICtrlSetResizing($idEdit, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) Local $idOK = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will close the GUI GUICtrlSetResizing($idOK, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER) Local $idCancel = GUICtrlCreateButton("Annuler", 25, -1) ; add the button that will close the GUI GUICtrlSetResizing($idCancel, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE + $GUI_DOCKHCENTER) WinMove($gui, "", 100, 100, 400, 200) GUISetState(@SW_SHOW) ; to display the GUI ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc ;==>Example However by accIdent, i found the solution: Put winMove() AFTER the guiSetState()!!!! Making that change magically makes it work! While you didn't provide a solution, I found the solution while making an example to show the problem so i could get help finding a solution, so...thanks? Edited June 13, 2017 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2017 Moderators Share Posted June 13, 2017 corgano, This caught me out a few years ago - apparently a fix to the code to get the $WS_EX_RTL style to work correctly meant that from 3.3.13.19 onwards, you need to use GUISetState before any WinMove commands or the autoresizing will not work. I was told at the time that the Help file would be modified to reflect this but I cannot find anything so I will look to add something myself. M23 corgano 1 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 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