0

Hello sir,
I am having treeview control and webbrowser control.
I Having three nodes in treeview.
Node0 -> ParentNode
Node1 -> ChildNode
Node2 -> ChildNode
So when i click Node1, i want some webpage to be displayed in webbrowser control and similarly with node2.

2
Contributors
6
Replies
10
Views
8 Years
Discussion Span
Last Post by bharanidharanit
0

Assume you've parent node and its child two nodes with text (www.microsoft.com and www.daniweb.com)
From treeview event handler, double click on NodeMouseClick

Private Sub treeView1_NodeMouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles treeView1.NodeMouseClick
        webBrowser1.Url = New Uri("http://" + e.Node.Text)
    End Sub
0

webBrowser1.Navigate(e.Node.Text)

I used the text property as this, but not working

Application.Startuppath & "\Source\main.html\"

But this code works with the form load event as

webbrowser1.navigate (Application.Startuppath & "\Source\main.html\")

Edited by Reverend Jim: Fixed formatting

0

I don't understand you, your question was to open web page in webbrowser control when selecting a node... I thought my code works, let me know what texts nodes hold?

0

I solved it, use file name in the tag with the extension and use the below coding

WebBrowser1.Navigate(Application.StartupPath & "\Source\" & e.Node.Tag)

0

I solved this, use file name in the tag with the extension and use the below coding

WebBrowser1.Navigate(Application.StartupPath & "\Source\" & e.Node.Tag)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.