以下是引用hytizj023在2023-3-2 19:33:41的发言:
对就是这个效果,能不能来点代码,参考一下
核心代码
程序代码:
FOR i=1 TO FCOUNT()
zd=FIELD(i)
og.columns(i).header1.alignment=2
IF BETWEEN(i,11,FCOUNT())
og.columns(i).header1.caption=RIGHT(FIELD(i),1)
ENDIF
DO CASE
CASE BETWEEN(i,2,4) OR INLIST(i,9)
og.columns(i).DynamicBackColor="Icase(lx=1,RGB(255,0,0),lX=2,RGB(255,35,255),lX=3,RGB(20,128,255),lX=4,RGB(20,128,20),lX=5,RGB(255,128,20),RGB(255,255,255))"
CASE BETWEEN(I,11,20) OR BETWEEN(I,31,40) OR BETWEEN(I,51,60)
og.columns(i).DynamicBackColor="IIF(BETWEEN(&zd,'0','9'),RGB(255,0,0),RGB(255,255,255))"
og.columns(i).DynamicForeColor="IIF(BETWEEN(&zd,'0','9'),RGB(255,255,255),RGB(192,192,192))"
og.columns(i).DynamicAlignment="IIF(BETWEEN(&zd,'0','9'),2,3)"
og.columns(i).DynamicFontSize="IIF(BETWEEN(&zd,'0','9'),12,9)"
og.columns(i).DynamicFontBold="IIF(BETWEEN(&zd,'0','9'),.T.,.F.)"
CASE BETWEEN(I,21,30) OR BETWEEN(I,41,50)
og.columns(i).DynamicBackColor="IIF(BETWEEN(&zd,'0','9'),RGB(0,0,255),RGB(255,255,255))"
og.columns(i).DynamicForeColor="IIF(BETWEEN(&zd,'0','9'),RGB(255,255,255),RGB(192,192,192))"
og.columns(i).DynamicAlignment="IIF(BETWEEN(&zd,'0','9'),2,3)"
og.columns(i).DynamicFontSize="IIF(BETWEEN(&zd,'0','9'),12,9)"
og.columns(i).DynamicFontBold="IIF(BETWEEN(&zd,'0','9'),.T.,.F.)"
ENDCASE
ENDFOR