DigDeep Posted August 14, 2017 Share Posted August 14, 2017 Do we have any example of this already or can someone help to get this please? The GUI Form should not expand / Contract. It should be only the Lable and buttons to Hide / Unhide. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 631, 494, 776, 200) $Label1 = GUICtrlCreateLabel("Label1", 80, 16, 476, 73) $Button1 = GUICtrlCreateButton("Button1", 112, 64, 75, 25) $Button2 = GUICtrlCreateButton("Button2", 112, 168, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Button3 = GUICtrlCreateButton("Button3", 120, 272, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Button4 = GUICtrlCreateButton("Button4", 120, 352, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Close = GUICtrlCreateButton("Close", 288, 440, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; This will expand the Lable until 457 height and show the buttons 2, 3, 4 and Close Case $Close ;This will contract the Lable back to 73 height and hide the buttons Close, 4, 3 and 2 EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2017 Moderators Share Posted August 14, 2017 DigDeep, You do not need to dig too far down: expandcollapse popup#include <GUIConstantsEx.au3> $Form2 = GUICreate("Form2", 631, 494, 776, 200) $Label1 = GUICtrlCreateLabel("Label1", 80, 16, 476, 73) GUICtrlSetState(-1, $GUI_DISABLE) ; Otherwise Button 1 will not work because of the overlap GUICtrlSetBkColor(-1, 0xFFCCCC) $Button1 = GUICtrlCreateButton("Button1", 112, 64, 75, 25) $Button2 = GUICtrlCreateButton("Button2", 112, 168, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Button3 = GUICtrlCreateButton("Button3", 120, 272, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Button4 = GUICtrlCreateButton("Button4", 120, 352, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) $Close = GUICtrlCreateButton("Close", 288, 440, 75, 25) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 ControlMove($Form2, "", $Label1, 80, 16, 476, 457) For $i = $Button2 To $Close GUICtrlSetState($i, $GUI_SHOW) Next ; This will expand the Lable until 457 height and show the buttons 2, 3, 4 and Close Case $Close ControlMove($Form2, "", $Label1, 80, 16, 476, 73) For $i = $Button2 To $Close GUICtrlSetState($i, $GUI_HIDE) Next ;This will contract the Lable back to 73 height and hide the buttons Close, 4, 3 and 2 EndSwitch WEnd Note that the trick using the ControlIDs as the loop limiters will only work if the controls are created consecutively. 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...
DigDeep Posted August 14, 2017 Author Share Posted August 14, 2017 thanks 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