Public oForm oForm = Createobject('myForm') m.oForm.Show Define Class myForm As Form DataSession=2 Add Object grdTest As HighLighted Procedure Load Use employee Endproc Enddefine Define Class HighLighted As Grid Height = 200 Width = 320 ccurrecbackcolor = (Rgb(255,255,192)) ccurrecforecolor = (Rgb(0,0,0)) HighLightRow = .F. Highlight = .F. Protected lingrid lingrid = .T. ncurrec = .F. Name = "highlighted" *-- Refresh when recpointer moves. For calling outside of grid. Procedure recchange With This .ncurrec = Recno(.RecordSource) .Refresh Endwith Endproc *-- Sets dynamicbackcolors Procedure setdyncolors With This .SetAll("DynamicBackColor", "IIF(RecNo(This.RecordSource) = This.nCurRec," + ; str(.ccurrecbackcolor)+","+Str(.BackColor)+")", "Column") .SetAll("DynamicForeColor", "IIF(RecNo(This.RecordSource) = This.nCurRec," + ; str(.ccurrecforecolor)+","+Str(.ForeColor)+")", "Column") .SetAll("Sparse",.F.) Endwith Endproc Procedure When This.lingrid = .T. Endproc Procedure Valid This.lingrid = .F. Endproc Procedure Init With This If !Empty(.RecordSource) .ncurrec = Recno(.RecordSource) EndIf Local loTextBox loTextbox = CreateObject('Textbox') .cCurrecBackColor = m.loTextBox.SelectedBackColor .cCurrecForeColor = m.loTextBox.SelectedForeColor .setdyncolors() Endwith Endproc Procedure BeforeRowColChange Lparameters nColIndex Thisform.LockScreen = This.lingrid Endproc Procedure AfterRowColChange Lparameters nColIndex With This .ncurrec = Recno(.RecordSource) Thisform.LockScreen = .F. If !.lingrid .Refresh() Endif Endwith Endproc EnddefineCetin