Click to See Complete Forum and Search --> : Load tab control using treeview childnode


Crystalelle
February 19th, 2008, 07:17 AM
Hi,

I am in desperate of help. I am a new user working with visual basic .net 2005. My interface is made from treeview control and tab control.

The big question here is how do I load the tab control using the treeview control child node. Can anyone give me a sample coding or appropriate instruction. I reading books and searching the whole internet and I can't find a solution for this.

Help Help!!

WoF
February 19th, 2008, 10:18 AM
Please explain in more detail.
What is the treeview data? Is it folders on disk or other data?
How do you want to fill a Tab control???
If you want to display data you need a ListBox or maybe even a ListView control, which you have to place in a tab of your Tab control.
If you tell more we can advise you better.

Crystalelle
February 20th, 2008, 01:39 AM
Hi,

I have a treeview control on my form with a list of tree nodes created on the left hand side of the interface. On the right hand is the tab control with current properties visibility set to false. I want to load the tab control upon selecting a child node of the tree.

On the tab control there will be textbox and buttons for users to enter their data.

I found the following code from this website but I am having problem running it...

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Dim node As TreeNode = CType(sender, Windows.Forms.TreeView).SelectedNode
If node = ???? Then
TabControl1.Visible = True
End If
End Sub

The child node name is 'Enter/Adjust Customer' when i put this in the program there is error of overload resolution. I know I have miss out stuff but clearly I am clueless as I am new to programming.

Please help...

WoF
February 20th, 2008, 04:00 AM
Ok. First thing i see is If node = 'text of the node' does not work
I don't have the IDE available now, but I'd say
If node.text = "Enter/Adjust Customer" then...
The expression node does not by default resolve into the text property of the node. You have to specify node.text explicitly.

Maybe there is still more to it. I can try later today.