VFP6:
在GRID的AFTERCOLROWCHANGE()事件中写入以下代码:
this.setall("dynamicbackcolor","iif(this.activerow=recno(),rgb(127,0,127),rgb(255,255,255))","columns")
this.setall("dynamicforecolor","iif(this.activerow=recno(),rgb(255,255,255),rgb(0,0,0))","columns")
仅适用于不逻辑删除记录的情况,对于此种情况,应该再行写入代码。
VFP8/VFP9
可以直接设GRID的ALLOWCELLSELECTION属性设为.F.
如果是8.0以上的话,可以通过设置Grid.HighlightStyle =2 来解决.