Function Reference


Defines the resizing method used by a control.

GUICtrlSetResizing ( controlID, resizing )


controlID The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.
resizing See the Docking Values table below for values that can be used (add together multiple values if required).

Return Value

Success: 1.
Failure: 0.


When a GUI window is resized the controls within react - how they react is determined by this function. To be able to resize a GUI window it needs to have been created with the $WS_SIZEBOX and $WS_SYSMENU styles. See GUICreate().

    Docking Values Table

Resizing Value No displacement of
$GUI_DOCKAUTO 1 resize and reposition according to new window size
$GUI_DOCKLEFT 2 Left side
$GUI_DOCKRIGHT 4 Right side
$GUI_DOCKHCENTER 8 Position will not move relative to horizontal center
$GUI_DOCKTOP 32 Top side
$GUI_DOCKBOTTOM 64 Bottom side
$GUI_DOCKVCENTER 128 Position will not move relative to vertical center
$GUI_DOCKWIDTH 256 Width will not change
$GUI_DOCKHEIGHT 512 Height will not change
Composite resizing
$GUI_DOCKSIZE 768 (256+512) Size will not change
$GUI_DOCKMENUBAR 544 (512+32) so the control will stay at the top of window with no change in Height
$GUI_DOCKSTATEBAR 576 (512+64) so the control stay at the bottom of the window with no change in Height
$GUI_DOCKALL 802 (2+32+256+512) so the control will not move during resizing
$GUI_DOCKBORDERS 102 (2+4+32+64) so the control will grow as the window

The default resizing for a given control is control dependent see the control doc.
A default value for any control can be set with GUIResizeMode (Option).

The automatic resizing event can be disabled if GUIEventOptions (Option) is set to 1.


GUICtrlCreate..., GUIEventOptions (Option), GUIResizeMode (Option)


#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Func Example()
    Opt("GUICoordMode", 2)
    GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; start the definition

    GUISetFont(8, -1, "Arial")

    GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

    Local $idEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ; add the input area
    GUICtrlSetState($idEdit, $GUI_FOCUS)
    GUICtrlSetResizing($idEdit, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)

    Local $idOK = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will close the GUI

    Local $idCancel = GUICtrlCreateButton("Annuler", 25, -1) ; add the button that will close the GUI

    GUISetState(@SW_SHOW) ; to display the GUI

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE

EndFunc   ;==>Example