ppat Posted February 26, 2009 Posted February 26, 2009 I would like to increase the height of a GUI without touching the controls in the GUI. Here is my code: expandcollapse popup#include <GuiConstants.au3> GuiCreate("Countdown", 400, 89) GuiSetIcon("C:\WINDOWS\system32\cmd.exe", 0) ; GROUP WITH RADIO BUTTONS GuiCtrlCreateGroup("Shutdown ", 10, 9,100,70) $shutdown_yes = GuiCtrlCreateRadio("Yes", 30, 29, 40) GuiCtrlSetState($shutdown_yes, $GUI_CHECKED) $shutdown_no = GuiCtrlCreateRadio("No", 30, 49, 40) ; Progress bar $progress = GuiCtrlCreateProgress(120, 29, 270, 20) GuiCtrlSetData($progress, 100) GUISetState(@SW_SHOW) MsgBox(0,"Start", "Look at the GUI!") increase_GUI_height("Countdown",100) MsgBox(0,"The end", "Did you see how awful the GUI now looks?") Func increase_GUI_height($current_GUI_title, $delta_height) $nb_steps = 70 $resize_time_ms = 200 $micro_delta_height = $delta_height/$nb_steps $size = WinGetPos($current_GUI_title) $new_height = $size[3] $sleep_ms = $resize_time_ms / $nb_steps ; Increase the height of the GUI Window by small steps For $i = $nb_steps to 1 Step -1 $new_height += $micro_delta_height WinMove($current_GUI_title, "", Default, Default, Default, $new_height) Sleep($sleep_ms) Next EndFunc I would like the result to be the same as if I had declared GuiCreate("Countdown", 400, 189) (189 = initial 89 + added 100) in the first place. However the result shows distorted controls in the GUI. How can I avoid this?
Moderators Melba23 Posted February 26, 2009 Moderators Posted February 26, 2009 ppat,Look at GUICtrlSetResizing in the Help file.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
jvanegmond Posted February 26, 2009 Posted February 26, 2009 (edited) Hi, the default value of the AutoIt option GUIResizeMode is 0.If you place this in your code controls will not move and not resize:Opt("GUIResizeMode", $GUI_DOCKALL)$GUI_DOCKALL = 802but is also defined in #include <GUIConstantsEx.au3>or ( not sure )#include <WindowsConstants.au3> Edited February 26, 2009 by Manadar github.com/jvanegmond
Moderators Melba23 Posted February 26, 2009 Moderators Posted February 26, 2009 Manadar, Thank you for that. Always happy to learn something new everyday! That wonderful Help file is TOO big sometimes.... 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
jvanegmond Posted February 26, 2009 Posted February 26, 2009 Likewise, Melba23. ;] github.com/jvanegmond
ppat Posted February 26, 2009 Author Posted February 26, 2009 Manadar, thanks, #include <GuiConstants.au3> Opt("GUIResizeMode", $GUI_DOCKALL) does the trick.
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