以文本方式查看主题

-  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=80321)

--  作者:苍风霁月
--  发布时间:2016/1/20 16:53:00
--  表格的表头颜色可否自定义啊?
如题,谢谢!
--  作者:大红袍
--  发布时间:2016/1/20 16:56:00
--  

Dim t As Table = Tables("表A")
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式1")

cs1.forecolor = Color.red
cs1.backcolor = Color.yellow
cs1.Border.Width = 3
cs1.Border.Color = Color.Red
cs1.Border.Direction = 0
For i As Integer = 0 To 0
    For j As Integer = 1 To t.cols.count
            t.Grid.SetCellStyle(i, j, cs1)       
    Next
Next


--  作者:苍风霁月
--  发布时间:2016/1/20 17:29:00
--  
谢谢!
--  作者:playmal
--  发布时间:2019/3/4 7:39:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:无标题.png
图片点击可在新窗口打开查看

--  作者:playmal
--  发布时间:2019/3/4 7:39:00
--  
为啥多层表头不能同时变色啊。
--  作者:有点甜
--  发布时间:2019/3/4 9:07:00
--  

Dim t As Table = Tables("表A")
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式1")

cs1.forecolor = Color.red
cs1.backcolor = Color.yellow
cs1.Border.Width = 3
cs1.Border.Color = Color.Red
cs1.Border.Direction = 0
For i As Integer = 0 To t.HeaderRows-1
    For j As Integer = 1 To t.cols.count
            t.Grid.SetCellStyle(i, j, cs1)       
    Next
Next

 


--  作者:playmal
--  发布时间:2019/3/4 20:57:00
--  
如何在指定的列改掉颜色,包含表头和表内容行?
--  作者:有点蓝
--  发布时间:2019/3/4 21:19:00
--  
Dim t As Table = Tables("表A")
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式1")
cs1.forecolor = Color.red
cs1.backcolor = Color.yellow
cs1.Border.Width = 3
cs1.Border.Color = Color.Red
cs1.Border.Direction = 0
Dim range = t.Grid.GetCellRange(0, 2,t.Grid.rows.count - 1,2) ‘第二列
range.Style = cs1