* browse.prg LPARAMETERS justaparameter oForm=Createobject("browform") oForm.Show(PCOUNT()) Return oForm Define Class browform As Form Add Object oGrid As Grid With RecordSource=Alias() Procedure Activate This.Caption="Browse "+this.ogrid.recordsource This.Resize Endproc Procedure oGrid.Init Local i, N SET PROCEDURE TO browse.prg For i=1 To This.ColumnCount With This.Columns[i] cSource=.ControlSource cType=Type(cSource) Do Case Case cType="L" .addobject("check","gcheck") .Check.visible=.t. .RemoveObject("text1") .CurrentControl="check" .Check.ReadOnly=.F. .Sparse=.f. Endcase Endwith Endfor Endproc Procedure Resize With This.oGrid .Top=0 .Left=0 .Width=This.Width .Height=This.Height .SetAll("selectonentry",.F.) Endwith Endproc Enddefine DEFINE CLASS gcheck AS checkbox caption_yes = ("Yes") caption_no = ("No") Name = "gcheck" PROCEDURE Init * fire value_assign this.value=this.value ENDPROC PROCEDURE value_assign LPARAMETERS vNewVal if !empty(m.vNewVal) and !empty(this.caption_yes) this.caption=this.caption_yes endif if Empty(m.vNewVal) and !empty(this.caption_no) this.caption=this.caption_no endif this.refresh THIS.Value = m.vNewVal ENDPROC PROCEDURE InteractiveChange this.value=this.value ENDPROC PROCEDURE Click dodefault() this.refresh nodefault ENDPROC ENDDEFINE