M
Maileen
Hi,
I have a TabControl with 2 TabPages (TabPage1 and TabPage2).
I have a TreeView control with 2 nodes (Page1 and Page2).
When i click on Page1 node, I want to display the TabPage1...the same
thing for Page2 node (TabPage2).
This is easy to do using selectedIndex = ...
But i would like to do it in another way.
Evertime that i select a node in my TreeView, i generate a AfterSelect
event. This event as an argument which is e. This argument can be used
to determine the value of selected node by using e.Node.Text.
and here starts my question. I would like to do something like that :
-----------------------
Private Sub TreeView1_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
TCPreferences.SelectedTab = CType("Tab" & e.Node.Text, TabPage)
End Sub
-----------------------
I know that i can not cast it like that...but I would like to keep this
"direction"...how can i do ?
Thx,
Maileen
I have a TabControl with 2 TabPages (TabPage1 and TabPage2).
I have a TreeView control with 2 nodes (Page1 and Page2).
When i click on Page1 node, I want to display the TabPage1...the same
thing for Page2 node (TabPage2).
This is easy to do using selectedIndex = ...
But i would like to do it in another way.
Evertime that i select a node in my TreeView, i generate a AfterSelect
event. This event as an argument which is e. This argument can be used
to determine the value of selected node by using e.Node.Text.
and here starts my question. I would like to do something like that :
-----------------------
Private Sub TreeView1_AfterSelect(ByVal sender As Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
TCPreferences.SelectedTab = CType("Tab" & e.Node.Text, TabPage)
End Sub
-----------------------
I know that i can not cast it like that...but I would like to keep this
"direction"...how can i do ?
Thx,
Maileen