Foxtable(狐表)用户栏目专家坐堂 → 定义单元格字体


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

主题:定义单元格字体

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/12/31 17:08:00 [显示全部帖子]

必须用drawcell事件。

 

http://www.foxtable.com/help/topics/0656.htm

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/12/31 19:35:00 [显示全部帖子]

If e.Col.name = "第二列" Then
    Dim cl = e.Table.grid.getCellRange(e.Row.index+1, e.Col.index+1)
    If e.Row("第二列") = "D" Then
        If cl.style Is Nothing Then
            Dim t As Table = e.Table
            Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.grid.Styles.Add("cs1")
            cs1.backcolor = Color.Red
            cs1.font = new font ("宋体", 12)
            cl.style = cs1
        End If
    Else
        cl.Style = Nothing
    End If
End If

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/3 23:16:00 [显示全部帖子]

可以用 C1.Win.C1FlexGrid.CellStyle  临时性的设置样式,如4楼的代码

 

但是,设置是不保存的,所以要写到drawcell事件不断的设置。

 


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/4 15:49:00 [显示全部帖子]

Dim cl = e.Table.grid.getCellRange(e.Row.index+1, e.Col.index+1)
If e.Row("选择") = True Then
    If cl.style Is Nothing Then
        Dim t As Table = e.Table
        Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.grid.Styles.Add("cs1")
        cs1.backcolor = Color.Red
        cs1.font = new font ("宋体", 12)
        cl.style = cs1
    Else
        cl.style.backcolor = Color.Red
        cl.Style.font = new font ("宋体", 12)
    End If
Else
    cl.Style = Nothing
End If

 


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/4 16:25:00 [显示全部帖子]

1、设置成 cl.style.backcolor = Color.White

 

2、加粗参考 http://www.foxtable.com/help/topics/0494.htm

 


 回到顶部