TreeViews have plus symbols that we can click. To add one to our form find tree view control on tool box and use it in your form.

Now, to add Nodes to the TreeView, click the TreeView to select it. Then locate the Nodes property in the properties area

Click the button with the three dots in it, just to the right of Collection. You'll then see the TreeNode Editor Dialogue box.

There are two types of Nodes you can Add - a Root Node and a Child Node. Click the Add Root button.  

Set the following properties:

Name: Google
Text: Google

Name: Yahoo
Text: Yahoo!

Name: Bing
Text: Bing



Now, add a webBrowser to the form.


Now write the code for TreeView control’s at NodeMouseClick Event.

private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
            TreeNode nName = e.Node;
            string webPage = "";
            webPage = (string)nName.Tag;
//seting webPage to node tag string.
            if (webPage != "")
//Navigating to webPage address.


  Modified On Nov-29-2017 11:55:36 PM

Leave Comment