Nov 7, 2010 02:28 PM
(This post was last modified: Nov 8, 2010 01:45 PM by Pulser.)
Tree View
Okay, so recently I have been seeing a lot of webbrowsers being posted. Now, that is all fine and dandy, but hey! It gets a little old. This is a tutorial on how to implement a Tree View.
[IMG]http://i55.[censored].com/zm12wx.gif[/IMG]
This tutorial is going to be a little different. I am going to do it all on a GIF and explain it step by step.
Spoiler (Click to View)
- Create a TreeView Control.
- Create a New WebBrowser Control.
- Go to the mouse click event of the treeview nodes.
- Insert:
Code
TreeNode site = e.Node; // New TreeNode. e.Node = clicked node
string url = string.Empty;
url = (string)site.Tag; // Accesses the tag that we setup "http://www.Google.com
webBrowser1.Navigate(url); // Navigates the browserI hope this aims people toward being more creative in their browsers!
Code
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode site = e.Node; // Sets up a new tree node object
string url = string.Empty; // a new string variable
url = (string)site.Tag;
webBrowser1.Navigate(url); // navigates to the tag we setup earlier
// Be sure to have it in the mouse click event
}http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.

