I have been working with c# for about a year and with Visual Studio for a couple months. I was debugging a web browser that I made and I found out that when I go to a web site other than google, the url on the search bar remains the same. even though I told it to change.

here's the code that tells the search bar to change

private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            textBox1.Text = webBrowser.Url.ToString();

and the full project is below. Any help will be appreciated. Thanks :)

8 Years
Discussion Span
Last Post by Flippers321

You are making one small mistake.

Select your webBrowser in the designer. In the properties panel switch to "Events" and for "DoucmentComplete" event select the "webBrowser_DocumentComplete".

OR you can do it via code:

webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);

so let me get this straight, Does the code that you posted go into the form designer?

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.