Foxtable(狐表)用户栏目专家坐堂 → 如何实现某一列的所有单元格边框颜色为红色


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

主题:如何实现某一列的所有单元格边框颜色为红色

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/29 14:32:00 [显示全部帖子]

方法一:drawcell事件

 

If e.Col.Name = "第一列"  Then
    e.StartDraw()
   
   
    Dim msg As String=e.Text
    Dim tl As Integer = e.Text.Length
    Dim w As Integer = e.Width -4
    Dim h As Integer = e.Height-4
    Dim x As Integer = e.x + (e.Width - w)/2
    Dim n As Pen
    Dim fnt As New Font("楷体",9,FontStyle.Bold)
    Dim br As Brush
    n = New Pen(Color.Green,2)
    br = New SolidBrush(color.Green)
    Dim sf As new StringFormat
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Center
    e.Graphics.DrawRectangle(n,x,e.y + 2,w,h)
    e.Graphics.DrawString(msg,fnt,Brushes.black,  new Rectangle(e.x, e.y, e.width, e.height), sf)
    e.Text = ""
    e.EndDraw()
End If


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/29 14:34:00 [显示全部帖子]

方法二:

 

Tables("表A").Grid.cols("第二列").Style.Border.Style = 2  
Tables("表A").Grid.cols("第二列").Style.Border.width = 2  
Tables("表A").Grid.cols("第二列").Style.Border.Color = Color.red


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/29 20:04:00 [显示全部帖子]

那不能设置【整行】,必须用drawcell事件【突出】

 

http://www.foxtable.com/webhelp/scr/0656.htm

 


 回到顶部