Foxtable(狐表)用户栏目专家坐堂 → 如何绘制符合条件的整个列


  共有2328人关注过本帖树形打印复制链接

主题:如何绘制符合条件的整个列

帅哥哟,离线,有人找我吗?
zhangchi96
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:555 积分:5037 威望:0 精华:0 注册:2012/2/11 13:27:00
如何绘制符合条件的整个列  发帖心情 Post By: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

 

以上是符合的单元格显示草绿蓝,如果把该单元格所在的整个列显示灰蓝,请教老师,该加什么代码?


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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
    For Each nr As Row In e.Table.rows
        If  nr("年级") = r("年级") And nr("班级") = r("班级") Then
            If nr(e.Col.name) = r("学科") Then
                e.Style = "灰蓝"

                exit for
            End If
        End If
    next
end if

If  e.Row("年级") = r("年级") And e.Row("班级") = r("班级") Then
    If e.Row(e.Col.name) = r("学科") Then
        e.Style = "草绿蓝"
    End If 
End If

 


 回到顶部
帅哥哟,离线,有人找我吗?
zhangchi96
  3楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:555 积分:5037 威望:0 精华:0 注册:2012/2/11 13:27:00
  发帖心情 Post By:2017/10/11 11:44:00 [只看该作者]

array.indexof(z1, e.Col.name) >= 0  这个语句不怎么好理解,能不能换其他的语句,感觉是间接查看是否包含的意思

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/10/11 12:05:00 [只看该作者]


 回到顶部