Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Using A TreeView With A WebBrowser

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 browser

I 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.
Interesting. You could kind of incorporate this into web browsers that are looking for a Bookmarking system.
(Nov 7, 2010 02:31 PM)Łost Wrote:  Interesting. You could kind of incorporate this into web browsers that are looking for a Bookmarking system.

Yup, you could implement this into anything really.
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
Nice. Now get their favicon and display as icon in treeview instead of + and -, that would look neat. :)
(Nov 7, 2010 10:02 PM)Coder Wrote:  Nice. Now get their favicon and display as icon in treeview instead of + and -, that would look neat. :)

Yeah, Ill implement some things later.
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
Damn fucking [censored] craped on your images o.o Change the image hosting.
(Nov 8, 2010 01:34 PM)⚖️ Lollipop ⚖️ Wrote:  Damn fucking [censored] craped on your images o.o Change the image hosting.

i updated it. sorry! 🤣🤣
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
One of my favorite controls..

short


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by twistedwebAug 2, 2018 07:53 AM 1 116 Aug 2, 2018 07:53 AM
Last Post: HFDone
[.NET] by [Eprouvez]Feb 1, 2018 12:18 PM 6 301 Feb 1, 2018 12:18 PM
Last Post: EdwardSn0wdent
[.NET] by [Eprouvez]Dec 8, 2017 04:08 AM 1 301 Dec 8, 2017 04:08 AM
Last Post: SaketSaket