954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Accessing local file into webbrowser control from treeview c#

Hi..

I am populating treeview using XML and then trying to access the nodes of treeview
into webbrowser to view the files using the following code..

Can anyone please guide me with this??

private void treeView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            webBrowser1.Navigate(treeView1.SelectedNode.Text);
        }


The following is the function to build treeview:-

private void BuildTreeView(XmlDocument doc)
        {
            treeView1.Nodes.Clear();
            treeView1.Nodes.Add(new TreeNode(doc.DocumentElement.Name));
            TreeNode tNode = new TreeNode();
            tNode = treeView1.Nodes[0];

            AddNode(doc.DocumentElement, tNode);
            treeView1.ExpandAll();

        }
bhagyap
Light Poster
38 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

It should be as follows:-

webBrowser.Navigate("E:\\testing\\"+treeview.SelectedNode.Text);

This will work perfectly fine...

bhagyap
Light Poster
38 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: