程序代码:
CLEAR ALL
Main()
CLEAR ALL
RETURN
PROCEDURE Main()
LOCAL loForm
loForm = CREATEOBJECT("C_Form")
WITH loForm
.Caption = "Test Container"
.Show
ENDWITH
READ EVENTS
ENDPROC
DEFINE CLASS C_Form AS Form
Width = 600
Height = 400
Picture = "20151111_112634_660.JPG"
MinButton = .F.
MaxButton = .F.
BorderStyle = 1
ADD OBJECT CheckGroup1 AS CheckGroup WITH Top = 5, Left = 5
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS CheckGroup AS Container
BackStyle = 0
ADD OBJECT Check1 AS CheckBox WITH Caption = "Check 1"
ADD OBJECT Check2 AS CheckBox WITH Caption = "Check 2"
ADD OBJECT Check3 AS CheckBox WITH Caption = "Check 3"
ADD OBJECT Check4 AS CheckBox WITH Caption = "Check 4"
PROCEDURE Init
WITH This
.SetAll("BackStyle", 0)
.Arrange
ENDWITH
ENDPROC
PROCEDURE Arrange
LOCAL loControl, lnCount
lnCount = 0
FOR EACH loControl AS CheckBox IN This.Controls FOXOBJECT
lnCount = lnCount + 1
WITH loControl
.Height = 20
.Width = 200
.Top = 5 + (lnCount - 1) * (.Height + 5)
.Left = 5
.Parent.Height = .Top + .Height + 5
.Parent.Width = .Left + .Width + 5
ENDWITH
ENDFOR
ENDPROC
ENDDEFINE
图片附件: 游客没有浏览图片的权限,请
登录 或
注册