S elect Case e.DataCol.Name
Case "级别"
Dim c1, c2, c3 As color
Dim s1, s2, s3 As String
Dim ss1(), ss2(), ss3() As String
Dim dt As DataTable = DataTables("颜色")
s1 = dt.DataRows(0)("一级")
s2 = dt.DataRows(0)("二级")
s3 = dt.DataRows(0)("三级")
If s1 Like "*[;]*" = False Then
c1 = Color.FromName(s1)
Else
ss1 = s1.split(";")
c1 = Color.FromARGB(255, CInt(ss1(0)), CInt(ss1(1)), CInt(ss1(2)))
End If
If s2 Like "*[;]*" = False Then
c2 = Color.FromName(s2)
Else
ss2 = s2.split(";")
c2 = Color.FromARGB(255, CInt(ss2(0)), CInt(ss2(1)), CInt(ss2(2)))
End If
If s3 Like "*[;]*" = False Then
c3 = Color.FromName(s3)
Else
ss3 = s3.split(";")
c3 = Color.FromARGB(255, CInt(ss3(0)), CInt(ss3(1)), CInt(ss3(2)))
End If
Dim dt2 As DataTable = DataTables("表格样式")
dt2.AddUserStyle("一级", c1, color.Black)
dt2.AddUserStyle("二级", c2, color.Black)
dt2.AddUserStyle("三级", c3, color.Black)
End S elect