现阶段需要做一个界面,左侧需要用到TreeView,初始化树的时候,感觉如果每个node多存储点信息就好,就知道选择的是根节点,还是子节点了,还可以保存一些其他的信息,就打算自定义treenode,以下为代码,用得着的看下。
#Region "自定义TreeNode"
Private Class ZZTreeNode
Inherits TreeNode
Private p_IsFirstName As Boolean = False ‘判断数据级别
Private p_IsSecondName As Boolean = False ‘判断数据级别
Public Property IsFirstName() As Boolean
Get
Return p_IsFirstName
End Get
Set(ByVal Value As Boolean)
p_IsFirstName = Value
End Set
End Property
Public Property IsSecondName() As Boolean
Get
Return p_IsSecondName
End Get
Set(ByVal Value As Boolean)
p_IsSecondName = Value
End Set
End Property
Public Sub New(ByVal Text As String)
MyBase.New(Text)
End Sub
End Class
#End Region