What is this article about?

Recently in the MSDN forums (link below) it was discovered that the WebBrowser control (IE 10 based) exhibits the following unexpected behavior while used on a UserControl:
MSDN Forums - WebBrowser control standard double-click behavior not working

Certain properties modified using the property grid in design mode seem to "break" at least one known ability of the WebBrowser control (The ability to highlight a word with a double-click)
  • Known properties to cause the error
    • WebBrowser.AllowWebBrowserDrop
    • WebBrowser.ScriptErrorsSuppressed

The mentioned properties have a default value at design time. When that default value is modified using the property grid at design time, the IDE automatically generates code in the InitializeComponent sub of whatever control/form your are editing. When you change one of the default mentioned properties that code gets added to the designer, because it is no longer default, well at this point, even if you use the designer to changed it back, instead of deleting that entire line it added, it just changes the value being set in that line.

Evidence points that the error is not caused by a specific value set to the mentioned properties, but more along the lines of the fact that a value changed. This means that at the time of the unexpected behavior, the value could be true, false, or nothing, and the same error will occur. So basically, really what causes the problem is the existence of code in the initializeComponent sub that modifies the mentioned properties (regardless of the value being modified to).

*It is quite possible other properties could have a similar issue... Which I imagine the soon to be explained workaround would also apply...


Very simple

  • Do not use the property grid to modify the mentioned properties.
  • Comment out any designer generated code that may have modified the mentioned properties.
  • Find a load event to modify the properties from code, instead of using the property grid (designer).
  • Modifying the webbrowser's properties from the usercontrol's load event might work.
  • Instead if it doesn't, then modify the properties from the load event of the form that contains the usercontrol.


This article is a brief overview of the problem. Visit the original forum post here.

I hope you find this helpful!

See Also

An important place to find a huge amount of Visual C# related articles is the TechNet Wiki itself. The best entry point is
 Visual C# Resources on the TechNet Wiki

no registration counter
Visitors Counter