Define Class form1 As Form
Top = 0
Left = 0
Height = 600
Width = 1000
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
AutoCenter = .T.
Add Object optiongroup1 As OptionGroup With ;
Buttoncount = 5, ;
Left = 24, ;
Top = 60, ;
Visible = .T., ;
Width = 300, ;
height = 300, ;
Name = "optiongroup1"
Procedure Init
thisform.optiongroup1.option1.Caption = 'xxxxx'
thisform.optiongroup1.option2.Caption = 'xxxxx'
Endproc
这里的optiongroup1 里的option1的caption属性无法修改,请问原因是什么呢?谢谢。
------解决方案--------------------------------------------------------
FORM1 = NEWOBJECT("C_FORM")
FORM1.SHOW
READ EVENTS
RETURN
DEFINE CLASS C_FORM AS FORM
AUTOCENTER=.T.
CAPTION="表单查询示例"
SHOWTIPS=.T.
ADD OBJECT COMMAND1 AS COMMANDBUTTON WITH TOP=6,LEFT=290,HEIGHT=28,CAPTION="表格重置",AUTOSIZE=.T.
ADD OBJECT OPTIONGROUP1 AS OPTIONGROUP WITH TOP=6,LEFT=10,HEIGHT=28,BUTTONCOUNT=2,AUTOSIZE=.T.
ADD OBJECT GRID1 AS GRID WITH TOP=((THISFORM.HEIGHT-THISFORM.GRID1.HEIGHT)/2)+20,LEFT=(THISFORM.WIDTH-THISFORM.GRID1.WIDTH)/2
PROCEDURE COMMAND1.CLICK
SET FILTER TO
FORM1.GRID1.REFRESH
FORM1.OPTIONGROUP1.VALUE=0
ENDPROC
PROCEDURE OPTIONGROUP1.INIT
WITH THIS
.VALUE=0
.OPTION2.TOP=.OPTION1.TOP
.OPTION2.LEFT=.OPTION1.WIDTH+29
FOR I=1 TO THIS.BUTTONCOUNT
.BUTTONS(I).AUTOSIZE=.T.
.BUTTONS(I).CAPTION=IIF(MOD(I,2)=1,"男","女")
ENDFOR
ENDWITH
ENDPROC
PROCEDURE OPTIONGROUP1.CLICK
SET FILTER TO TABNAME.性别==FORM1.OPTIONGROUP1.BUTTONS(FORM1.OPTIONGROUP1.VALUE).CAPTION
FORM1.GRID1.REFRESH
ENDPROC
PROCEDURE GRID1.INIT