表单INIT事件代码
Create Cursor T (A1 N(4),A2 N(4),A3 N(4))
Insert Into T Values (10,100,1000)
Insert Into T Values (1000,10,100)
Insert Into T Values (100,1000,10)
Go Top
With ThisForm.Grid1 .ColumnCount=Fcount("T") .RecordSource="T" .RecordSourceType=1 For lnI=1 To .ColumnCount myField=Field(lnI) .Columns(lnI).DynamicForeColor="Iif(Between(&myField,10,100),Rgb(255,0,0),Rgb(0,0,0))" && 前景色 .Columns(lnI).DynamicBackColor="Iif(Between(&myField,10,100),Rgb(0,0,255),Rgb(0,255,0))" && 背景色 Endfor .Refresh
EndWith
与前面的有所不同