在论坛看到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