以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  窗口DrawCell部份不执行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=130244)

--  作者:nxhylczh
--  发布时间:2019/1/16 19:12:00
--  窗口DrawCell部份不执行
窗口Sql表
窗口的afteload 事件中增加有
DataTables("录入凭证_Table2").AddUserStyle("样式1", Color.Snow , Color.Black)
DataTables("录入凭证_Table2").AddUserStyle("样式2", Color.LightGray, Color.Black)

Table2 表中的DrawCell事件中,Tables表中有一列“样式” 值为True和False
        e.StartDraw
        For i As Integer = 1 To 10
            If i Mod 3 = 0 Then
                If i = 9 Then
                    pn = Pens.Red
                Else
                    pn = Pens.LightSlateGray
                End If
            Else
                pn = Pens.tan
            End If
            n = cint(e.Width / 11)  \'获取单位宽度
            e.Graphics.DrawLine(pn,e.x+i*n,e.y,e.x+i*n,e.y+e.Height)
            If e.Row.IsNull(e.Col.Name) = False Then
                e.text = ""
                e.Graphics.DrawString(cstr(GetDigit(e.Row(e.Col.name),8-i)),new Font("雅黑",9),Brushes.Black,e.x +(i+1/5)*n,e.Y + e.Height*1/5)
            End If
        Next

        If e.Row("样式")=True Then
            e.style="样式1"
        Else
            e.style="样式2"
        End If
        e.EndDraw

金额线能执行
设置行不同颜色不执行
执行后的图如下

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




--  作者:有点甜
--  发布时间:2019/1/16 20:06:00
--  

 

执行这个e.Graphics以后,就无法设置e.style的。

 

你可以用e.Graphics画矩形,如 http://www.foxtable.com/webhelp/scr/1482.htm

 


--  作者:nxhylczh
--  发布时间:2019/1/16 20:45:00
--  
e.StartDraw
If e.Row("样式")=True Then
    e.style="样式1"
Else
    e.style="样式2"
End If
e.EndDraw


DrawCell 中只留这一点  也不执行!

--  作者:nxhylczh
--  发布时间:2019/1/16 20:55:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:0a60bd2322a8fc3cbf27042a036ff4c.png
图片点击可在新窗口打开查看
重新调了一下顺序 部分执行 但是  
会变得非常 卡


--  作者:有点甜
--  发布时间:2019/1/16 20:57:00
--  

1、执行

 

If e.Row("样式")=True Then
    e.style="样式1"
Else
    e.style="样式2"
End If

 

2、如果还有,实例发上来测试。