#include $left = 5 ; The distance of the labels from the left edge of the window $top = 10 ; First label's distance from the top edge of the window $width = 100 ; Width of labels $height = 25 ; Height of labels $row_spacing = 30 ; Vertical distance between the labels $GUI = GUICreate('Calculate exact scrollheight for dynamic labels after maximize window') For $i = 1 To 50 GUICtrlCreateLabel('Label ' & $i, $left, $top, $width, $height) GUICtrlSetBkColor(-1, 0xFFFFFF) $bot = $top + $height ; Bottom edge of the last label $top = $bot + $row_spacing ; Top of next label Next GUISetState() $win = WinGetClientSize($GUI) $norm = $win[1] ; Height of normal window GUISetState(@SW_MAXIMIZE) $win = WinGetClientSize($GUI) $max = $win[1] ; Height of maximized window $pegr = $max / $norm ; Percentage growth $GUIScrollbarsHeight = ($bot * $pegr) If $GUIScrollbarsHeight >= $max Then _GUIScrollbars_Generate($GUI, 0, $GUIScrollbarsHeight) EndIF While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch Wend