Jump to content

GUI Resize - Stationary Buttons


 Share

Recommended Posts

How do I make my buttons stationary when I resize my GUI? The buttons and image will float 

#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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...