以文本方式查看主题

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

--  作者:thz706
--  发布时间:2020/12/31 8:53:00
--  [求助]全局代码提示错误
在论坛看到2015年的帖子《设置treeview目录树》(http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=72839&skin=0),在我的商业版2019版中使用文中全局代码,提示错误。
全局代码:

Public Sub myTreeView_DrawNode(ByVal sender As Object, ByVal e As Windows.Forms.DrawTreeNodeEventArgs)
If e.Node.Level = 0
    e.Graphics.DrawString(e.Node.Text, new font("宋体", 15), Brushes.Red, e.Bounds)
Else If e.Node.Level = 1
    e.Graphics.DrawString(e.Node.Text, new font("宋体", 8), Brushes.Blue, e.Bounds.x, e.Bounds.y + 5)
Else
    e.Graphics.DrawString(e.Node.Text, new font("宋体", 8), Brushes.Blue, e.Bounds.x, e.Bounds.y + 5)
End If

End Sub


错误提示:



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




--  作者:有点蓝
--  发布时间:2020/12/31 9:56:00
--  
Public Sub myTreeView_DrawNode(ByVal sender As Object, ByVal e As system.Windows.Forms.DrawTreeNodeEventArgs)