Click here to Skip to main content
13,348,874 members (77,823 online)
Click here to Skip to main content


334 bookmarked
Posted 28 Mar 2006

Extended .NET 2.0 WebBrowser Control

, 29 Mar 2006
Extending the .NET 2.0 WebBrowser control.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ExtendedWebBrowser2.Properties;

namespace ExtendedWebBrowser2
  partial class OptionsForm : Form
    public OptionsForm()

    private void OptionsForm_Load(object sender, EventArgs e)
      SettingsHelper helper = SettingsHelper.Current;
      switch (helper.FilterLevel)
        case PopupBlockerFilterLevel.High:
          this.filterLevelHighRadioButton.Checked = true;
        case PopupBlockerFilterLevel.Medium:
          this.filterLevelMediumRadioButton.Checked = true;
        case PopupBlockerFilterLevel.Low:
          this.filterLevelLowRadioButton.Checked = true;
          this.filterLevelNoneRadioButton.Checked = true;
      this.doNotShowScriptErrorsCheckBox.Checked = !helper.ShowScriptErrors;

      // Check if we're working on Windows XP SP2 or higher.
      // Since the .Net Framework 2.0 requires SP2 to be installed,
      // and for Windows 2003 requires SP1 we do not need to check against 
      // the service pack level. We DO need to check the version number.
      if (!(Environment.OSVersion.Version.Major >= 5 && Environment.OSVersion.Version.Minor >= 1))
        // The requirements for the pop-up blocker aren't met. 
        // Disable the groupbox with the settings.
        this.popupBlockerGroupBox.Enabled = false;

    private void okButton_Click(object sender, EventArgs e)
      SettingsHelper helper = SettingsHelper.Current;
      if (this.filterLevelHighRadioButton.Checked)
        helper.FilterLevel = PopupBlockerFilterLevel.High;
      else if (this.filterLevelMediumRadioButton.Checked)
        helper.FilterLevel = PopupBlockerFilterLevel.Medium;
      else if (this.filterLevelLowRadioButton.Checked)
        helper.FilterLevel = PopupBlockerFilterLevel.Low;
        helper.FilterLevel = PopupBlockerFilterLevel.None;
      helper.ShowScriptErrors = !this.doNotShowScriptErrorsCheckBox.Checked;
      DialogResult = DialogResult.OK;


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Jeroen Landheer
Web Developer
Chile Chile
I am
- born in The Netherlands
- living in Chile together with my wife.
- a Microsoft Certified Professional Developer on all 3 areas (Windows, Web and Enterprise)
- an MCITP on Microsoft SQL Server 2005 (Database Administrator)
- an active programmer for about 14 years.
- a business owner, of a Dutch company called "The Wheel Automatisering" (
- a coder in C#, VB.Net and Managed C++.
- someone who likes to share knowledge

For fun I like to go out with my dogs, enjoy the sun or write some articles that I share with the community.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 29 Mar 2006
Article Copyright 2006 by Jeroen Landheer
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid