I may be wrong, but I do not believe that WebBrowserControl includes the address bar, toolbar, etc. I believe that you will need to create your own address bar. You can use events Navigatedor Navigatingto determine when the URL changes and updates the text box.
private void button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBox1.Text))
{
webBrowser1.Navigate(textBox1.Text);
}
}
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (textBox1.Text != e.Url.ToString())
{
textBox1.Text = e.Url.ToString();
}
}
Edit: my form has TextBoxthe name textBox1, a Buttonwith the name button1 and WebBrowserControlwith the name webBrowser1
source
share