以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]窗口表颜选中行颜色设置报错  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=188727)

--  作者:81538475
--  发布时间:2023/10/13 18:22:00
--  [求助]窗口表颜选中行颜色设置报错
Tables("报价表信息核对_table1).SysStyles("CurrentRow").BackColor = Color.White
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2023/10/14 8:36:00
--  
少个双引号

Tables("报价表信息核对_table1").SysStyles("CurrentRow").BackColor = Color.White

--  作者:81538475
--  发布时间:2023/10/16 9:41:00
--  
嗯嗯。多谢,不过我发现这个并不能改变listmode 开启后的这个颜色, 这个是如何用代码修改呢
--  作者:有点蓝
--  发布时间:2023/10/16 9:45:00
--  
改为其它颜色试试,表格默认背景默认就是白色的
--  作者:81538475
--  发布时间:2023/10/16 10:27:00
--  
改成其他颜色了,但是listmode 的颜色还是没有变化。
--  作者:有点蓝
--  发布时间:2023/10/16 10:46:00
--  
我测试没有问题

Tables("表A").ListMode = True
Tables("表A").SysStyles("CurrentRow").BackColor = Color.blue

--  作者:81538475
--  发布时间:2023/10/16 14:21:00
--  
我发现是什么问题了。是drawcell里面的代码有影响,但是我吧这行代码放到drawcell 的最后一行的话,效果还是会被覆盖。有什么好的办法吗
--  作者:有点蓝
--  发布时间:2023/10/16 14:34:00
--  
drawcell有什么代码
--  作者:81538475
--  发布时间:2023/10/16 14:35:00
--  
If e.Row.IsNull("绑定编号") =False Then
    If e.Row("_identify") = e.Table.Current("_identify") Then
        e.style = "绑定2"
    Else
        e.style="绑定"
    End If
End If
e.Table.grid.Cols(0).widthdisplay = 4
If e.Row.IsNull("商务颜色记录") = False Then
    Dim n As String = "样式" & e.Row("_Identify") & "_" & e.Col.name
    Dim ary() As String = e.Row("商务颜色记录").split("|")
    For Each s As String In ary
        Dim a() As String = s.split(":")
        If a(0) = e.Col.name Then
            e.Table.DataTable.AddUserStyle(n, Color.FromARGB(a(1)), Color.black)
            e.Table.DataTable.Styles(n).BackColor = Color.FromARGB(a(1))
            e.style = n
            Exit For
        End If
    Next
End If
If e.Row("状态") = "客户通过" AndAlso e.Col.Name = "来源" Then
    e.style = "客户通过"
End If
If e.Row("状态") = "可开票" AndAlso e.Col.Name = "来源" Then
    e.style = "可开票"
End If
If e.Row("状态") = "长期未结算" AndAlso e.Col.Name = "来源" Then
    e.style = "长期未结算"
End If
If e.Row("状态") = "未付款" AndAlso e.Col.Name = "来源" Then
    e.style = "未付款"
End If
e.Table.SysStyles("CurrentRow").BackColor = Color.lightblue

--  作者:有点蓝
--  发布时间:2023/10/16 14:45:00
--  
e.Table.SysStyles("CurrentRow").BackColor = Color.lightblue
改为
If e.Row.index = e.table.rowsel Then
    e.style = "当前行样式"
End If

添加一个当前行样式,去掉listmode ,设置为false