Hi, I'm making a web browser in visual C# and I need to make the address bar change when a new page loads. Here is the code I am using:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
textBox2.Text = webBrowser1.Url;
}
and I get this error: "Cannot implicitly convert 'System.Uri" to 'string'"
Any insight into why this happens would be great.

2 answers
I figured it out, I had to use the convert class to make the uri a string, for those who would like to know how this was done, check this out:
string url1;
url1 = Convert.ToString(webBrowser1.Url);
textBox2.Text = url1;
answered 2 years ago by:
61
This is a bit off-topic, but i want to tell you something:
1. The web-browser that you use in Visual C# is Internet Explorer, what you want to do is to change it's user interface.
2. To make a web-browser, is complicated business. What a browser does is grabbing a HTML (PHP,ASP) page from some server, reads it's code and draws the items on a page according to the HTML code. Coding a browser is awful, all you do is to change IE's interface.
You look like you just started to learn C#. I started working at a tutorial a few weeks ago, unfortunately i did not finished it yet. If you are interested you can find it here: http://davidevitelaru.comze.com/resources/Visual%20C%23.pdf
If you are interested in some team-work and learning more about C#, you can always mail me at davide.vitelaru@gmail.com
answered 2 years ago by:
181