注册 登录
编程论坛 VFP论坛

求助,浏览表使连号突出显示!

wangguowu 发布于 2024-05-08 15:40, 361 次点击
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
SELECT dlt
Browse Name oBrowse Nowait noed titl ">>~"
oBrowse.AutoFit()
oBrowse.setall("format","Z","column")
oBrowse.BackColor = RGB(128,128,128)
oBrowse.GridLineColor = RGB(128,128,128)
oBrowse.SetAll("backcolor",RGB(255,255,255),"textbox")
oBrowse.setall("Dynamicbackcolor","RGB(255,255,255)","Column")
*-
For ii = 1 To obrowse.ColumnCount
    If ii = 1
        obrowse.Columns(ii).DynamicBackColor = "IIF(kjqh#'',RGB(236,233,216),RGB(255,255,255))"
    Endif
    If ii = 2
        obrowse.Columns(ii).DynamicBackColor = "IIF(bl='3:2',RGB(221,216,185), RGB(255,255,255))"
    Endif
    If ii = 4
        obrowse.Columns(ii).DynamicBackColor = "IIF(ACZ=4 or ACZ=5 or ACZ=6,RGB(221,216,185), RGB(255,255,255))"
    Endif
    If ii = 6
        obrowse.Columns(ii).DynamicBackColor = "IIF(='0' or ='1',RGB(221,216,185), RGB(255,255,255))"
    Endif
For ii = 1 To obrowse.ColumnCount
    If ii = 8 or ii=9
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s1) and !EMPTY(s2),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 10 or ii=11
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s3) and !EMPTY(s4),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 12 or ii=13
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s5) and !EMPTY(s6),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 14 or ii=15
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s7) and !EMPTY(s8),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 16 or ii=17
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s9) and !EMPTY(s10),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 18 or ii=19
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s11) and !EMPTY(s12),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 20 or ii=21
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s13) and !EMPTY(s14),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 22 or ii=23
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s15) and !EMPTY(s16),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 24 or ii=25
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s17) and !EMPTY(s18),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 26 or ii=27
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s19) and !EMPTY(s20),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 28 or ii=29
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s21) and !EMPTY(s22),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 30 or ii=31
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s23) and !EMPTY(s24),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 32 or ii=33
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s25) and !EMPTY(s26),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 34 or ii=35
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s27) and !EMPTY(s28),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii = 36 or ii=37
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s29) and !EMPTY(s30),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii=38 OR ii=39 OR ii=40
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s31) and !EMPTY(s32) or !EMPTY(s32) and !EMPTY(s33),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR

For ii = 1 To obrowse.ColumnCount
    If ii=40 OR ii=41 OR ii=42
        obrowse.Columns(ii).DynamicBackColor = "IIF(!EMPTY(s33) and !EMPTY(s34) or !EMPTY(s34) and !EMPTY(s35),RGB(221,216,185),RGB(255,255,255))"
    Endif
ENDFOR
ENDFOR
*===========================================================================================================
7 回复
#2
wangguowu2024-05-08 15:44
只有本站会员才能查看附件,请 登录
#3
jinanshui2024-05-08 19:57
老师,我不会,想向您请教一下,怎么从网上爬取的这些数据,谢谢
#4
wangguowu2024-05-08 20:05
回复 3楼 jinanshui
只有本站会员才能查看附件,请 登录




#5
jinanshui2024-05-08 20:33
谢谢
#6
shizi02024-05-09 00:18
Grid.init写入:
With This
For i=8 To .ColumnCount
    j=i-7
    Do Case
    Case i=8
        .Columns(i).DynamicBackColor=[Iif(S]+Transform(j+1)+[=S]+Transform(j)+[+1,Rgb(150,150,150),Rgb(255,255,255))]
    Case i=.ColumnCount   
        .Columns(i).DynamicBackColor=[Iif(S]+Transform(j)+[=S]+Transform(j-1)+[+1,Rgb(150,150,150),Rgb(255,255,255))]
    Otherwise     
        .Columns(i).DynamicBackColor=[Iif(S]+Transform(j)+[=S]+Transform(j-1)+[+1 or S]+Transform(j+1)+[=S]+Transform(j)+[+1,Rgb(150,150,150),Rgb(255,255,255))]
    Endcase     
Endfor
Endwith
 
#7
shizi02024-05-09 00:28
只有本站会员才能查看附件,请 登录
#8
wangguowu2024-05-09 08:10
回复 7楼 shizi0
谢谢!完结!
1