Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:这样做出来单元格,能加背景色吗?

1楼
xxfoxtable 发表于:2024/9/20 0:30:00
   drawcell事件划的表格,还能加背景颜色吗?
Tables("定单明细_table1").Cols("齿位").Width = 400
    Tables("定单明细_table1").DefaultRowHeight = 40
    e.Text = ""
    e.StartDraw()
    e.Graphics.DrawLine(pens.black, e.X, CSng(e.y + e.Height / 2), e.X + e.Width, CSng(e.y + e.Height / 2))
    e.Graphics.DrawLine(pens.black, CSng(e.X + e.Width / 2), e.y, CSng(e.X + e.Width / 2), e.y + e.Height)
    If e.Row.IsNull("齿位") = False Then
        Dim sr() As String = e.Row("齿位").Split(":")
        Dim size As Object
        size = e.Graphics.MeasureString(sr(0), e.Table.Font, e.Width)
        e.Graphics.DrawString(sr(0), e.Table.Font, Brushes.Black, CSng(e.X + e.Width / 2) - size.Width - 1, e.Y + 1)
        '        If sr.Length > 1 Then
        
        e.Graphics.DrawString(sr(1), e.Table.Font, Brushes.Black, CSng(e.X + e.Width / 2) + 1, e.Y + 1) 
        'e.Graphics.DrawString(sr(1), e.Table.Font, Brushes.Black, CSng(e.X + a) + 1, e.Y + 1)
        '        End If
        '        If sr.Length > 1 Then
        size = e.Graphics.MeasureString(sr(2), e.Table.Font, e.Width)
        e.Graphics.DrawString(sr(2), e.Table.Font, Brushes.Black, CSng(e.X + e.Width / 2) - size.Width - 1, CSng(e.y + e.Height / 2) + 1) 
        '        End If
        '        If sr.Length > 1 Then
        
        e.Graphics.DrawString(sr(3), e.Table.Font, Brushes.Black, CSng(e.X + e.Width / 2) + 1, CSng(e.y + e.Height / 2) + 1) 
        '        End If 
    End If 
    e.EndDraw()

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

2楼
有点蓝 发表于:2024/9/20 8:42:00
先画背景再画线:http://www.foxtable.com/webhelp/topics/1482.htm


e.StartDraw()
e.Graphics.FillPolygon(Brushes.Green,......
    e.Graphics.DrawLine(pens.black, ....
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01953 s, 2 queries.