有一个两级的目录树,节点名称与TabControl页名称一致,如何做到点击目录树的第二级节点TabControl自动打开对应的页我在目录树的NodeMouseClick事件里编辑代码如下:
Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
Select Case e.Node.Level
Case 0
For i As Integer = 0 To tab.TabPages.Count - 1
If tab.TabPages(i).Name = e.Node.Name Then
tab.SelectedIndex = i
Return
End If
Next
Case 1
For i As Integer = 0 To tab.TabPages.Count - 1
If tab.TabPages(i).Name = e.Node.parentnode.Name Then
tab.SelectedIndex = i
Return
End If
Next
End Select
为什么实现不了