lucamad Posted October 27, 2010 Share Posted October 27, 2010 Hi This is a simple GUI with a group and a listview controls. During a GUI resize, the controls position change, so the original window aspect becomes bad. Look at the attached image: the black boxes are what I don't want to see.Normal:Resized:How to avoid this behavior? It seems that the "group" control is resized different from the other controls, as the listview in example. The resize of "group" control is the best for me, because it is pulled up to the maximum size, without empty space in the window.I tried all the possible resize arrangements with koda designer, but with no success.I also tried to work with WM_SIZING function but I don't know which code to write...In the forum there are many open 3d but in the examples I've found, this problem is present. What do u think about?THXForm1.au3 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 27, 2010 Moderators Share Posted October 27, 2010 lucamad,Just addOpt("GUIResizeMode", 102)at the top of your script. You can use the Help file to work out why 102 is the number to use! M23 Xandy 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...
lucamad Posted October 28, 2010 Author Share Posted October 28, 2010 lucamad, Just add Opt("GUIResizeMode", 102) at the top of your script. You can use the Help file to work out why 102 is the number to use! M23 Good! Works fine... So the number 102 is: dock left, dock right, dock top and dock bottom. Very usefull for simple GUI. I'm making another example now, more complicated, to learn the controls resize ways. Draw near to real-world examples! Would you help me? In this new example, I'm not able to control some controls resizing options. In particular: - the $buttonselectFolder should remain close to textbox ($txtFolder) during resize - the $input2 textbox moves away from $labelTest during resize - the treeview and listview move away from each other during resize, generating empty space. Is there a solution? Thanks Melba! expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=form1.kxf $Form1 = GUICreate("Form1", 618, 394, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP)) $groupSelectFolder = GUICtrlCreateGroup("Folder", 8, 8, 601, 57) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT) $labelSelectFolder = GUICtrlCreateLabel("Folder name:", 40, 32, 65, 17) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT) $txtFolder = GUICtrlCreateInput("", 112, 28, 313, 21) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT) $buttonselectFolder = GUICtrlCreateButton("...", 432, 32, 35, 17) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $buttonOk = GUICtrlCreateButton("OK", 520, 24, 75, 25) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateGroup("", -99, -99, 1, 1) $groupFiles = GUICtrlCreateGroup("Files", 8, 72, 601, 313) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) $TreeView1 = GUICtrlCreateTreeView(24, 120, 185, 257, BitOR($GUI_SS_DEFAULT_TREEVIEW,$WS_BORDER)) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) $TreeView1_0 = GUICtrlCreateTreeViewItem("Example Tree", $TreeView1) $ListView1 = GUICtrlCreateListView("Col1|Col2", 216, 120, 386, 257) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) $ListView1_0 = GUICtrlCreateListViewItem("Item1", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("Item2", $ListView1) $Input1 = GUICtrlCreateInput("Input1", 48, 96, 121, 21) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKHEIGHT) $Input2 = GUICtrlCreateInput("Input2", 328, 96, 185, 21) GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKHEIGHT) $labelTest = GUICtrlCreateLabel("Test Label:", 264, 100, 57, 17) GUICtrlSetResizing(-1, $GUI_DOCKTOP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndForm1.zip Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2010 Moderators Share Posted October 28, 2010 lucamad,Is there a solution?Quite possibly - but I use resizing code very little in my own scripts so I cannot offer much more help. If you put Opt("GUIResizeMode", $GUI_DOCKAUTO) at the top of your script and remove all the GUICtrlSetResizing lines, the reult is not too bad - you get the relative positions maintained, but the sizes alter. Is that any better? 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 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