Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:37:19+00:00 2026-06-04T05:37:19+00:00

This may come across as incredibly stupid, but I cannot figure out if: I

  • 0

This may come across as incredibly stupid, but I cannot figure out if:

  • I am an idiot
  • I have misunderstood something
  • The MS Web Browser control is bugged

I prefer to think that it is the latter.

I have a Web Browser control in a WinForms user control. It has been added to the control at design time, and in theory, in the Load event of the control it should navigate to Google.

Seems straightforward.

However.

public partial class TVHost : UserControl
{
    public TVHost()
    {
        InitializeComponent();
    }

    private void TVHost_Load(object sender, EventArgs e)
    {     
        webBrowser1.Navigate("http://google.co.uk");  
    }
}

This doesn’t work. No error, just nothing. Inserting a breakpoint/debug lines shows me that the Load event doesn’t even get called.

I decided at this point to check that the Load event is being set correctly in the Designer.cs file.

 this.Load += new System.EventHandler(this.TVHost_Load);

Seems legit.

If I remove the web browser control from the form, the load event fires.

I don’t understand this one bit, how can a control prevent a method which uses it from firing in the first place?

Moving on, I found this:
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/d6e427b2-9cc9-4318-bb05-11363025e3f7/

TL;DR for the link is as follows: “Load won’t work if you have a webbrowser on the form which is set to Visible = true”

So sure as hell, if I change the default visibility of the webbrowser to false, the load event of the control fires. I can work around the problem by setting the visibility of the browser in the load event.

private void TVHost_Load(object sender, EventArgs e)
{
    webBrowser1.Visible = true;
    webBrowser1.Navigate("http://google.co.uk");
}

Very odd.

Whilst this “fix” works, I find it incredibly hacky and was wondering if anybody has any explaination for this behaviour?

Amazingly I have found this bug in MS Connect, left over from 2005 – http://connect.microsoft.com/VisualStudio/feedback/details/116535/when-adding-a-webbrowser-control-to-a-user-control-the-load-will-not-fire#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:37:21+00:00Added an answer on June 4, 2026 at 5:37 am

    From the discussion in the Connect bug you linked to:

    For now, if you want to get the Load event to fire, you can set the URL property of the WebBrowser control in the property grid. The URL can be anything you want, even about:blank if you don’t want it to start with a page loaded.

    So if you go into the designer and set the WebBrowser‘s Url property to the string about:blank (which tells the WebBrowser to load an empty page), then your user control should start getting its Load event again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I understand this may come across as a open question, but I need
Okay this may be a simple question but I have yet to come with
This may be a stupid question but I have a code with the following
This may come across as a terribly lazy question, but I assure you it
This may be an unusual question, but are there any resources people have come
I know this may come across as a newbie question, but I'm curious as
While browsing MSDN documentation, you may come across this gem: TextBox.Watermark. Awesome! I've been
This may be a bit of daft question, but I don't come from an
This may be have a better name than custom tab completion, but here's the
This may sound like a very generic question but here it goes. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.