DF Posted January 31, 2016 Share Posted January 31, 2016 Hi Let's say I have a dialog with menu and tabs at top, and status bar at bottom, and I want to insert a list view in between. Can I make the list view to automatically resize itself to fill in unused portion of the dialog? I did not find any other way except calculating the size myself. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 31, 2016 Moderators Share Posted January 31, 2016 DF, Welcome to the AutoIt forums. Take a look at GUICtrlSetResizing in the Help file - it is all automatic if you set the correct values. 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...
DF Posted January 31, 2016 Author Share Posted January 31, 2016 49 minutes ago, Melba23 said: DF, Welcome to the AutoIt forums. Take a look at GUICtrlSetResizing in the Help file - it is all automatic if you set the correct values. M23 Thanks, Melba23 This seems to resize control when I resize dialog, but I still cannot make control to initially fill dialog. I guess that must be done by trial and error. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 31, 2016 Moderators Share Posted January 31, 2016 DF, Of course not - you just need to calculate it: #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> $hGUI = GUICreate("Test", 500, 500) ; Create menu and status bar $mMenu = GUICtrlCreateMenu("File") $mExit = GUICtrlCreateMenuItem("Exit", $mMenu) $hStatus = _GUICtrlStatusBar_Create($hGUI) ; Create tab control $cTab = GUICtrlCreateTab(10, 10, 480, 200) $cTab0 = GUICtrlCreateTabItem("Tab 0") $cTab1 = GUICtrlCreateTabItem("Tab 1") GUICtrlCreateTabItem("") ; Get internal GUI size $aClient = WinGetClientSize($hGUI) ; Get status bar height $iStatus_Ht = _GUICtrlStatusBar_GetHeight($hStatus) ; Calculate remaining height $iLabel_Height = $aClient[1] - 10 - 200 - 10 - 10 - $iStatus_Ht ; Internal Ht top margin tab height margin tab/label bottom margin status bar $cLabel = GUICtrlCreateLabel("", 10, 220, 480, $iLabel_Height) GUICtrlSetBkColor($cLabel, 0xFF0000) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Please ask if you have any questions. 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...
DF Posted February 1, 2016 Author Share Posted February 1, 2016 (edited) Understood, I will use something similar to this and dock everything in place. I was hoping there would be one-liner or style flag etc. to do all of this. Thank you for quick response :-) Edited February 1, 2016 by DF Detail 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