#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Dim $Label[6], $hLine[6] $Form1 = GUICreate("Form1", 633, 454, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, _ $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, _ $WS_SIZEBOX)) $vLine = GUICtrlCreateLabel("", 155, 75, 1, 195) GUICtrlSetBkColor(-1, 0xFF0000) Dim $aGraphPos = ControlGetPos($Form1, "", $vLine) Global $Height = $aGraphPos[3] Local $LabelTop = 95, $hLineTop = 120 For $i = 1 To 5 $Label[$i] = GUICtrlCreateLabel("Label1", 20, $LabelTop, 131, 20, $WS_BORDER) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKHEIGHT)) $hLine[$i] = GUICtrlCreateGraphic(6, $hLineTop, 300, 1) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKHEIGHT)) GUICtrlSetBkColor(-1, 0x000000) $LabelTop += 30 $hLineTop += 30 Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESIZED, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE _Resize() EndSwitch WEnd Func _Resize() Local $aLabelPos = ControlGetPos($Form1, "", $Label[1]) GUICtrlSetPos($vLine, $aLabelPos[0] + $aLabelPos[2] + 5, $aLabelPos[1] - 20, 1, $Height) EndFunc |