grid的init事件加入:
this.SetAll("backcolor",RGB(140,170,220), "header")
this.SetAll("alignment",2,"header")
this.SetAll("alignment",2,"column")
thisform.Grid1.SetAll("DynamicBackColor", "IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255) , RGB(227,227,227))", "Column")&&这是一运行时显示一行灰色一行白色很好看的。
grid的afterRowcolchange加入以下:
Mcurrec=allt(str(recn()))
this.setall("dynamicbackcolor",'IIF(RECNO()=&Mcurrec.,RGB(236,236,236),RGB(255,255,255))')
thisform.refresh&&这是焦点移至某一行显示的颜色。