同类控件的子控件的属性,怎么Set All
程序代码:
&&百钱买百鸡.prg CLEAR ALL oForm = CREATEOBJECT("C_fm1") WITH oForm .Caption = "百钱买百鸡(穷解法)" .AutoCenter = .T. .Show .minHeight=380 .minWidth=375 ENDWITH READ EVENTS CLEAR ALL RETURN DEFINE CLASS C_fm1 AS Form ADD OBJECT cmdExit AS CommandButton WITH Caption = "退出", Height = 25, Width = 85 ADD OBJECT pgfContent AS PageFrame PROCEDURE Arrange LOCAL lnIndex WITH This.cmdExit .Top = ThisForm.Height - .Height - 5 .Left = ThisForm.Width - .Width - 6 ENDWITH WITH This.pgfContent .Top = 5 .Left = 5 .Height = This.cmdExit.Top - 5 .Width = This.Width - .Left - 5 .Pages[1].Arrange .Pages[2].Arrange ENDWITH ENDPROC PROCEDURE Init WITH This.pgfContent .AddObject("Page1", "C_Page1") .AddObject("Page2", "C_Page2") ENDWITH ENDPROC PROCEDURE Activate This.Arrange ENDPROC PROCEDURE Resize This.Arrange ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC PROCEDURE cmdExit.Click RELEASE ThisForm ENDPROC ENDDEFINE DEFINE CLASS C_Page1 AS Page Caption = "问题描述" ADD OBJECT Label1 AS Label WITH Caption = "百钱买百鸡," ADD OBJECT Label2 As Label WITH Caption = "公鸡、母鸡、小鸡都要买,各能几只?" ADD OBJECT Label3 AS Label WITH Caption = "铜钱一百" ADD OBJECT Label4 AS Label WITH Caption = "公鸡一只五钱" ADD OBJECT Label5 AS Label WITH Caption = "母鸡一只三钱" ADD OBJECT Label6 AS Label WITH Caption = "小鸡三只一钱" PROCEDURE Init WITH This .SetAll("WordWrap", .T., "Label") .SetAll("FontSize", 10, "Label") .SetAll("AutoSize", .T., "Label") ENDWITH ENDPROC PROCEDURE Arrange LOCAL lnIndex FOR lnIndex = 1 TO This.ControlCount WITH This.Controls[lnIndex] .Top = 15 + (lnIndex - 1) * (.Height + 5) .Left = 10 .Width = This.Parent.Width - .Left - 10 ENDWITH NEXT ENDPROC ENDDEFINE DEFINE CLASS C_Page2 AS Page Caption = "解答" ADD OBJECT label1 AS editBox WITH Top = 5, Left = 5,WordWrap=.t. ADD OBJECT grid1 as Grid WITH columnCount=6,left=5 ADD OBJECT grid2 as Grid WITH columnCount=6,left=5 PROCEDURE Arrange WITH This.label1 .Height =( .Parent.Parent.PageHeight-20) / 3 .Width = .Parent.Parent.PageWidth-10 .readOnly=.t. .value=" 根据题意,可列方程:cocks+hens+chicks=100,5*cocks+3*hens+chicks/3=100。"+; "可见,这是一组不定方程。对于不定方程,要先确定一个变量的范围,才能对其求解。"+; "由问题,容易初步判定cocks,hens,chicks的取值范围:"+CHR(13)+; "cocks:0~19,hens:0~33,chicks:0~100"+CHR(13)+; " 基本的解题思路是:依次取cocks值域中的一个值,然后求其余两数,看是否合题意,合乎者为解。" ENDWITH WITH this.grid1 .Height =( .Parent.Parent.PageHeight-20) / 3 .Width = .Parent.Parent.PageWidth-10 .top=.parent.label1.height+10 ENDWITH WITH this.grid2 .Height =( .Parent.Parent.PageHeight-20) / 3 .Width = .Parent.Parent.PageWidth-10 .top=.parent.label1.height+.parent.grid1.height+15 ENDWITH WITH This .SetAll(".Header1.caption","穷举次数", "Grid") &&???两个表格控件的标题都一样,怎么一起搞定呢? ENDWITH ENDPROC PROCEDURE init CREATE CURSOR tempBqbj; (穷举次数 i,; 公鸡数 i,; 母鸡数 i,; 小鸡数 i,; 所用金额 n(5,2),; 是解否 l) i=0 FOR c=0 TO 19 FOR h=0 TO 33 ch=100-c-h temp=5*c+3*h+ch/3 i=i+1 IF temp=100 INSERT INTO tempBqbj VALUES(i,c,h,ch,temp,.t.) ELSE INSERT INTO tempBqbj VALUES(i,c,h,ch,temp,.f.) ENDIF ENDFOR ENDFOR this.grid1.recordSourceType=4 this.grid1.recordSource="sele * from tempBqbj into cursor aaa" this.grid2.recordSourceType=4 this.grid2.recordSource="sele * from tempBqbj where 是解否=.t. into cursor fff" ENDPROC ENDDEFINE