furrycow Posted July 23, 2009 Share Posted July 23, 2009 Ok, so all i am trying to do is resize a GUI, however when i use this code, (just an example i made, i know only one control actually works).. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 218, 306, 193, 125) $Group1 = GUICtrlCreateGroup("Group1", 8, 8, 201, 129) $Buttonresize = GUICtrlCreateButton("Hide", 120, 32, 81, 25, 0) GUICtrlSetOnEvent($Buttonresize,"_Resize") $Label1 = GUICtrlCreateLabel("Label1", 24, 40, 36, 17) $Button2 = GUICtrlCreateButton("Button2", 120, 64, 81, 25, 0) $Button3 = GUICtrlCreateButton("Button3", 120, 96, 81, 25, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) $List1 = GUICtrlCreateList("", 8, 144, 201, 149) GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func _Resize() $ExpandREAD=GUICtrlRead($Buttonresize) If $ExpandREAD="Hide" Then $WindowPOS=WinGetPos("Form1") WinMove ( "Form1", "", Default, Default, $WindowPOS[2], 140) GUICtrlSetData($Buttonresize,"Show") Else $WindowPOS=WinGetPos("Form1") WinMove ( "Form1", "", Default, Default, $WindowPOS[2],306) GUICtrlSetData($Buttonresize,"Hide") EndIf EndFunc Everything just shifts up/changes size and the rest of it, whereas all i want is for the LIST control to "disappear" if you know what i mean; for it to be hidden rather than deleted! I am vaguely aware of some Opt() function, but having a little play around with it, i was unable to get the result i wanted...any help would be GREATLY APPRICIATED!! thanks in advance! Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
KaFu Posted July 23, 2009 Share Posted July 23, 2009 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 218, 306, 193, 125) $Group1 = GUICtrlCreateGroup("Group1", 8, 8, 201, 129) $Buttonresize = GUICtrlCreateButton("Hide", 120, 32, 81, 25, 0) GUICtrlSetOnEvent($Buttonresize, "_Resize") $Label1 = GUICtrlCreateLabel("Label1", 24, 40, 36, 17) $Button2 = GUICtrlCreateButton("Button2", 120, 64, 81, 25, 0) $Button3 = GUICtrlCreateButton("Button3", 120, 96, 81, 25, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) $List1 = GUICtrlCreateList("", 8, 144, 201, 149) GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func _Resize() $ExpandREAD = GUICtrlRead($Buttonresize) If $ExpandREAD = "Hide" Then GUICtrlSetState($List1, $GUI_HIDE) GUICtrlSetData($Buttonresize, "Show") Else GUICtrlSetState($List1, $GUI_SHOW) GUICtrlSetData($Buttonresize, "Hide") EndIf EndFunc ;==>_Resize OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
furrycow Posted July 23, 2009 Author Share Posted July 23, 2009 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 218, 306, 193, 125) $Group1 = GUICtrlCreateGroup("Group1", 8, 8, 201, 129) $Buttonresize = GUICtrlCreateButton("Hide", 120, 32, 81, 25, 0) GUICtrlSetOnEvent($Buttonresize, "_Resize") $Label1 = GUICtrlCreateLabel("Label1", 24, 40, 36, 17) $Button2 = GUICtrlCreateButton("Button2", 120, 64, 81, 25, 0) $Button3 = GUICtrlCreateButton("Button3", 120, 96, 81, 25, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) $List1 = GUICtrlCreateList("", 8, 144, 201, 149) GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func _Resize() $ExpandREAD = GUICtrlRead($Buttonresize) If $ExpandREAD = "Hide" Then GUICtrlSetState($List1, $GUI_HIDE) GUICtrlSetData($Buttonresize, "Show") Else GUICtrlSetState($List1, $GUI_SHOW) GUICtrlSetData($Buttonresize, "Hide") EndIf EndFunc ;==>_Resize Thanks for the quick reply kafu! but sorry i mustnt have phrased myself properly i want the window to get smaller, so the actual GUI goes from a height of 306 to 140, without the button/label/etc controls moving/changing size. thanks. Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
KaFu Posted July 23, 2009 Share Posted July 23, 2009 ...whereas all i want is for the LIST control to "disappear" if you know what i mean; for it to be hidden rather than deleted!... and you're looking for GUICtrlSetResizing(). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
furrycow Posted July 23, 2009 Author Share Posted July 23, 2009 What i want is shown in the following image:http://www.atcy68.dsl.pipex.com/untitled.bmpCheers Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
KaFu Posted July 23, 2009 Share Posted July 23, 2009 Sooo.... that's a combo of my first and my second post . Or just resize the GUI that the list is offscreen and fix the buttons and the group with GUICtrlSetResizing(). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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