Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共10 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:变色单元格

1楼
姗姗来迟 发表于:2011/11/20 14:44:00

表A中一共有11列其中用逻辑列隔开(逻辑列有可能是正常列也有可能是公式列)当第一个逻辑列成对号后之前的单元格会变成颜色不是前面整列弯如何实现 亲亲们

2楼
姗姗来迟 发表于:2011/11/20 14:44:00
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:变色.table

3楼
e-png 发表于:2011/11/20 15:31:00

不懂你的问题,例子中也没有任何数据,:“逻辑列成对号后”怎么理解? 我笨啊。

 

4楼
7032175 发表于:2011/11/20 15:56:00
逻辑列成对号后前面不是有几个单元格吗 而后自动变成一个颜色,打对号的逻辑列后面不是还有单元格吗就不变色,就是以逻辑列为准打上对号后前面的单元格变色。
5楼
e-png 发表于:2011/11/20 17:48:00
If (e.Row.IsNull(e.Col.Name) = False or e.Row.IsNull(e.Col.Name))And  e.Row("第四列") = True
    If Tables("表A").cols(e.Col.Name).Index < Tables("表A").cols("第四列").Index
        e.style = "zs"
    End If
End If
[此贴子已经被作者于2011-11-20 17:58:18编辑过]
6楼
小猪鑫鑫 发表于:2011/11/20 18:05:00
5楼的答案很强,学习了
7楼
y2287958 发表于:2011/11/20 18:21:00
Dim i As Integer = CurrentTable.Cols(e.Col.Name).Index
Select Case i
    Case 0 To 3
        If e.Row("第四列") = True
            e.style = "zs"
        End If
    Case 4 To 10
        If e.Row("第十一列") = True
            e.style = "sz"
        End If
End Select
8楼
e-png 发表于:2011/11/20 18:45:00

楼上的代码在列位置固定的时候很好用!  下面的可以随便拖动“逻辑列”到任何位置。

Dim n1,n2,n3 As Integer
n1 = Tables("表A").cols(e.Col.Name).Index
n2 = Tables("表A").cols("第四列").Index
n3 = Tables("表A").cols("第十一列").Index
If n3 > n2
    If  e.Row("第四列") = True And n1 < n2
        e.style = "zs"
    End If
    If e.Row("第十一列") = True
        If n2 < n1 And n1 < n3
            e.style = "sz"
        End If
    End If
Else
    If  e.Row("第四列") = True And n1 < n3
        e.style = "sz"
    End If
    If e.Row("第十一列") = True
        If n3 < n1 And n1 < n2
            e.style = "zs"
        End If
    End If   
End If

[此贴子已经被作者于2011-11-20 18:47:13编辑过]
9楼
姗姗来迟 发表于:2011/11/21 10:46:00

Dim n1,n2,n3 As Integer
n1 = Tables("表A").cols(e.Col.Name).Index
n2 = Tables("表A").cols("第四列").Index
n3 = Tables("表A").cols("第十一列").Index
If n3 > n2
If e.Row("第四列") = True And n1 < n2
e.style = "zs"
End If
If e.Row("第十一列") = True
If n2 < n1 And n1 < n3
e.style = "sz"
End If
End If
Else
If e.Row("第四列") = True And n1 < n3
e.style = "sz"
End If
If e.Row("第十一列") = True
If n3 < n1 And n1 < n2
e.style = "zs"
End If
End If
End If

 

 

这个代码运行起来会出现  如图


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20111121104445.png
图片点击可在新窗口打开查看
10楼
狐狸爸爸 发表于:2011/11/21 10:47:00
你放错位置了,应该放在DrawCell事件中.
共10 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03906 s, 3 queries.