以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请问这儿表样式如何做呢  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=72336)

--  作者:mxm121
--  发布时间:2015/7/28 15:17:00
--  请问这儿表样式如何做呢
表中如果行的 ischeckout为true  使用BillIsCheckOut样式

选择某行的时候 如果 ischeckout为true 则使用如下样式 
e.Table.DataTable.AddUserStyle("BillSelect", Color.RoyalBlue, Color.white) 
选择某行的时候  如果ischeckout为false 则使用如下样式
e.Table.DataTable.AddUserStyle("BillSelect", Color.RoyalBlue, Color.white)
e.Table.DataTable.Styles("BillSelect").FontStrikeout = True
这个应该怎么写呢
下面这样不对啊
以下内容为程序代码:

1 If e.Row.Index > = e.Table.TopPosition AndAlso e.Row.Index < = e.Table.BottomPosition Then
2 If e.Row("IsCheckOut") = True Then
3     e.Table.DataTable.AddUserStyle("BillSelect", Color.RoyalBlue, Color.white)
4     e.Table.DataTable.Styles("BillSelect").FontStrikeout = True
5 e.Style = "BillSelect"
6 Else
7     e.Table.DataTable.AddUserStyle("BillSelect", Color.RoyalBlue, Color.white)
8 e.Style = "BillSelect"
9 End If
10
11 Else
12 e.Table.DataTable.AddUserStyle("BillIsCheckOut", Color.White, Color.Black)
13 e.Table.DataTable.Styles("BillIsCheckOut").FontStrikeout = True
14 If e.Row("IsCheckOut") = True Then
15 e.Style = "BillIsCheckOut"
16 End If
17 End If

[此贴子已经被作者于2015/7/28 15:18:35编辑过]

--  作者:大红袍
--  发布时间:2015/7/28 15:40:00
--  

1、代码

 

If e.Row.Index > = e.Table.TopPosition AndAlso e.Row.Index < = e.Table.BottomPosition Then
    If e.Row("IsCheckOut") = True Then
        e.Table.DataTable.AddUserStyle("BillSelect1", Color.RoyalBlue, Color.white)
        e.Table.DataTable.Styles("BillSelect1").FontStrikeout = True
        e.Style = "BillSelect1"
    Else
       e.Table.DataTable.AddUserStyle("BillSelect2", Color.RoyalBlue, Color.white)
       e.Style = "BillSelect2"
    End If
Else
    e.Table.DataTable.AddUserStyle("BillIsCheckOut", Color.White, Color.Black)
    e.Table.DataTable.Styles("BillIsCheckOut").FontStrikeout = True
    If e.Row("IsCheckOut") = True Then
        e.Style = "BillIsCheckOut"
    End If
End If

2、要把风格去掉才行

 

标题区和选定区的背景颜色设置,只有在属性中的“使用界面”设置为False的时候,才会生效。