Create cursor myCursor (f1 c(10), f2 i, f3 l) Rand(-1) For ix = 1 to 10 Insert into myCursor values ( chr(65+ix-1), ix, (int(rand()*1000)%2 = 0) ) Endfor Go top oForm = createobject("Form") With oForm .Width = 500 .Height = 400 .Closable = .f. .AddObject("myQuit","myQuit") .myQuit.visible = .t. .AddObject("myGrid","Grid") With .myGrid .Left = 2 .Top = 2 .Width = 300 .Height = 350 .RecordSource = "myCursor" With .Columns(3) .Width = 22 .AddObject("myCheckBox","myChkBox",.ControlSource) && Pass controlsource to container .CurrentControl = "myCheckBox" .Sparse = .f. .myCheckBox.Visible = .t. Endwith .Visible = .t. Endwith .AddObject("KeyPressNotify","TextBox") .AddObject("DblClickNotify","TextBox") With .KeyPressNotify .Top = 2 .Left = 310 .Width = .Parent.Width - .Left - 2 .Visible = .t. Endwith With .DblClickNotify .Top = 4 + .Height .Left = 310 .Width = .Parent.Width - .Left - 2 .Visible = .t. Endwith .Show Endwith Read events Define class myChkBox as Container ControlSource = "" && Custom property Procedure init Lparameters tcControlSource With this If parameters()=1 .ControlSource = tcControlSource Endif .BackStyle = 0 && Transparent .BorderWidth = 0 .Width = .Parent.Width .Height = .Parent.Parent.RowHeight .AddObject("Txt1","myTxt") .AddObject("Chk1","myChk") .AddObject("Shp1","myShape") .Txt1.visible = .t. .Chk1.Visible = .t. .Shp1.Visible = .t. Endwith Endproc Enddefine Define class myChk as CheckBox Procedure init With this .Caption = "" .Height = 18 .Width = 18 .BackStyle = 0 && Transparent .Left = int((.Parent.Width - .Width) / 2) && Center horz. .Top = int((.Parent.Height - .Height) / 2) && Center vert. .ControlSource = .Parent.ControlSource && Get Controlsource from parent's custom prop. .Enabled = .f. Endwith Endproc Enddefine Define class myShape as Shape Procedure init With this .Left = 0 .Top = 0 .Width = .Parent.Width .Height = .Parent.Height .BackStyle = 0 && Transparent .BorderStyle = 0 Endwith Endproc Procedure dblClick Thisform.DblClickNotify.value = datetime() Endproc Enddefine Define class myTxt as textbox Left = -100 && Enabled but not visible Top = -100 Procedure keypress Lparameters nKeyCode, nShiftAltCtrl Thisform.KeyPressNotify.value = datetime() Endproc Enddefine Define class myQuit as CommandButton Procedure init With this .Caption = "Exit" .Left = 310 .Top = 380 Endwith Endproc Procedure Click Thisform.release Clear events Endproc EnddefineCetin