aa2zz6 Posted August 18, 2020 Posted August 18, 2020 How do I make my buttons stationary when I resize my GUI? The buttons and image will float expandcollapse popup#include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $hGUI = GUICreate("My_GUI", 800, 600, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_THICKFRAME)) GUISetBkColor(0xFFFFFF) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) ;$TabSheet1 = GUICtrlCreateTabItem("TabSheet1") ;$TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $btn1 = IconButton("Workforce", 5, 5, 160, 40, 30, "C:\Users\jnmiller\Desktop\New folder\workforce.ico") GUICtrlSetFont(-1, 11, 400, 0, 'Tahoma') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetcolor(-1, 0x000000) $btn1 = IconButton("Dashboard", 5, 55, 160, 40, 30, "C:\Users\jnmiller\Desktop\New folder\operations-dashboard.ico" , BitOr($BS_MULTILINE, $BS_VCENTER, $BS_RIGHT)) GUICtrlSetFont(-1, 11, 400, 0, 'Tahoma') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetcolor(-1, 0x000000) ;$Tab1 = GUICtrlCreateTab(24, 32, 561, 377) ;GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUIDelete() Exit Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconSize, $BIDLL, $BIconNum = -1) GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - $BIconSize) / 2), $BIconSize, $BIconSize) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc operations-dashboard.ico workforce.ico
pixelsearch Posted August 18, 2020 Posted August 18, 2020 Just add the following line twice, after GUICtrlCreateIcon() and after GUICtrlCreateButton() GUICtrlSetResizing(-1, $GUI_DOCKALL) aa2zz6 1 "I think you are searching a bug where there is no bug..."
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