VB treeview选中节点展开时其它节点都关闭功能
VB中treeview选中节点展开时其它节点都关闭,求代码你可以参考VB.net的代码,如下ProtectedSubTreeView1_TreeNodeExpanded(...
VB中 treeview选中节点展开时其它节点都关闭,求代码
你可以参考VB.net的代码,如下
Protected Sub TreeView1_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodeExpanded
Dim i As Integer
Dim value As Nullable(Of Boolean)
For i = 0 To TreeView1.Nodes.Count - 1
value = TreeView1.Nodes(i).Expanded
If value.HasValue Then
If e.Node IsNot TreeView1.Nodes(i) Then
If e.Node.Parent IsNot TreeView1.Nodes(i) Then
TreeView1.Nodes(i).CollapseAll()
End If
End If
End If
Next
End Sub 展开
你可以参考VB.net的代码,如下
Protected Sub TreeView1_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodeExpanded
Dim i As Integer
Dim value As Nullable(Of Boolean)
For i = 0 To TreeView1.Nodes.Count - 1
value = TreeView1.Nodes(i).Expanded
If value.HasValue Then
If e.Node IsNot TreeView1.Nodes(i) Then
If e.Node.Parent IsNot TreeView1.Nodes(i) Then
TreeView1.Nodes(i).CollapseAll()
End If
End If
End If
Next
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询