#include <GUIConstantsEx.au3>
local $Form1=GUICreate("组框控件 GUI")
GUISetState(@SW_SHOW)
$Gid=CreateGrp("组框1","20-20-90-140")
Local $cbxid1=AddIntoGrp("cbx","复选框 1",$Gid,"10/-120/-20/-120")
Local $edtid2=AddIntoGrp("edt","编辑框 2",$cbxid1,"0/10/0/0")
Local $rdoid3=AddIntoGrp("rdo","单选框 3",$edtid2,"0/10/0/0")
Local $lisid4=AddIntoGrp("lis","列表框 4",$rdoid3,"0/10/0/0")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func CreateGrp($title,$size);CreateGrp(组框标题,组框尺寸(以"-"分割的字符串))
local $sz=StringSplit($size,"-")
Local $Gid=GUICtrlCreateGroup($title,$sz[1],$sz[2],$sz[3],$sz[4])
GUICtrlCreateGroup("", -99, -99, 1, 1)
return $Gid
EndFunc ;==>Example
Func AddIntoGrp($Ctl,$txt,$PreCid,$incr);AddIntoGrp(控件类型,文本,参照控件ID,新控件相对参照控件的尺寸增量)
local $sz=ControlGetPos("","",$PreCid)
local $im=StringSplit($incr,"/")
local $CtlID
local $x=$sz[0]+int($im[1])
local $y=$sz[1]+$sz[3]+int($im[2])
local $w=$sz[2]+int($im[3])
local $h=$sz[3]+int($im[4])
Switch $Ctl
case "btn"
$CtlID=GUICtrlCreateButton($txt,$x, $y,$w,$h)
case "lab"
$CtlID=GUICtrlCreateLabel($txt,$x,$y,$w,$h)
case "grp"
$CtlID=GUICtrlCreateGroup($txt,$x,$y,$w,$h)
case "rdo"
$CtlID=GUICtrlCreateRadio($txt,$x,$y,$w,$h)
case "cbx"
$CtlID=GUICtrlCreateCheckbox($txt,$x,$y,$w,$h)
case "cbo"
$CtlID=GUICtrlCreateCombo($txt,$x,$y,$w,$h)
case "edt"
$CtlID=GUICtrlCreateEdit($txt,$x,$y,$w,$h)
case "inp"
$CtlID=GUICtrlCreateInput($txt,$x,$y,$w,$h)
case "lis"
$CtlID=GUICtrlCreateList($txt,$x,$y,$w,$h)
case "lsv"
$CtlID=GUICtrlCreateListView($txt,$x,$y,$w,$h)
case "dat"
$CtlID=GUICtrlCreateDate($txt,$x,$y,$w,$h)
case "mon"
$CtlID=GUICtrlCreateMonthCal($txt,$x,$y,$w,$h)
EndSwitch
return $CtlID
EndFunc