以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何绘制符合条件的整个列 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=107824) |
-- 作者:zhangchi96 -- 发布时间:2017/10/10 23:56:00 -- 如何绘制符合条件的整个列 Drawcell代码:
DataTables("网络总课表").AddUserStyle("草绿蓝", Color.GreenYellow, Color.DarkBlue ) DataTables("网络总课表").AddUserStyle("灰蓝", Color.Gainsboro, Color.Blue) Dim r As Row = Tables("网络教师课务明细表").current Dim z1() As String = { "周1_1","周1_2","周1_3","周1_4","周1_5","周1_6","周1_7","周2_1","周2_2","周2_3","周2_4","周2_5","周2_6","周2_7","周3_1","周3_2","周3_3","周3_4","周3_5","周3_6","周3_7","周4_1","周4_2","周4_3","周4_4","周4_5","周4_6","周4_7","周5_1","周5_2","周5_3","周5_4","周5_5","周5_6","周5_7" } For Each dc2 As String In z1 If e.Col.name = dc2 AndAlso r IsNot Nothing Then If e.Row("年级") = r("年级") And e.Row("班级") = r("班级") Then If e.Row(e.Col.name) = r("学科") Then e.Style = "草绿蓝" End If End If End If Next
以上是符合的单元格显示草绿蓝,如果把该单元格所在的整个列显示灰蓝,请教老师,该加什么代码? |
-- 作者:有点甜 -- 发布时间:2017/10/11 9:37:00 -- DataTables("网络总课表").AddUserStyle("草绿蓝", Color.GreenYellow, Color.DarkBlue ) DataTables("网络总课表").AddUserStyle("灰蓝", Color.Gainsboro, Color.Blue) Dim r As Row = Tables("网络教师课务明细表").current Dim z1() As String = { "周1_1","周1_2","周1_3","周1_4","周1_5","周1_6","周1_7","周2_1","周2_2","周2_3","周2_4","周2_5","周2_6","周2_7","周3_1","周3_2","周3_3","周3_4","周3_5","周3_6","周3_7","周4_1","周4_2","周4_3","周4_4","周4_5","周4_6","周4_7","周5_1","周5_2","周5_3","周5_4","周5_5","周5_6","周5_7" } If array.indexof(z1, e.Col.name) >= 0 Then exit for If e.Row("年级") = r("年级") And e.Row("班级") = r("班级") Then
|
-- 作者:zhangchi96 -- 发布时间:2017/10/11 11:44:00 -- array.indexof(z1, e.Col.name) >= 0 这个语句不怎么好理解,能不能换其他的语句,感觉是间接查看是否包含的意思 |
-- 作者:有点甜 -- 发布时间:2017/10/11 12:05:00 -- 以下是引用zhangchi96在2017/10/11 11:44:00的发言:
array.indexof(z1, e.Col.name) >= 0 这个语句不怎么好理解,能不能换其他的语句,感觉是间接查看是否包含的意思
不判断也可以,去掉这个判断也不会有错。
|