Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop / Win32

Tabbed IE Browser Control

0.00/5 (No votes)
3 Jul 2013CPOL2 min read 25.2K  
Tabbed Browser Control addon

Introduction 

This DLL can be added to your tool box, and then dragged onto your form in place of the normal WebBrowser control. This one is tab based, has a custom context menu that works. 

Background 

I have read hundreds of posts on various programming sites like this one with people trying to get help with:

  • Opening link in new Tab
  • Stopping a link from opening in Internet Explorer instead of the program.
  • Using a custom Context Menu in place of the built in one. 

Having educated myself with the answers posted, I have developed this UserControl DLL that simplifies all of that. 

Using the code 

Simply add the .dll to your project by right clicking in your toolbox and selecting  "Choose Item..." and navigate to where you downloaded the Tabbed_Browser.dll. Then drag the new control from the Toolbox onto your form.

There are several Public Variables, Subs, and controls that you can manipulate with your own code. For example, you can add a button to your project, name it HomeBtn and labeled Home.  Now, in the click event (double click the button to automatically add to code) you can do:

VB
Private Sub HomeBtn_Click(sender As System.Object, e As System.EventArgs) Handles HomeBtn.Click
    Tabbed_IE 1.GoHome()
    'This activates the same public sub used by the Home contextmenustrip item. 
End Sub

or add a textbox and a timer to your project and use the following code to see what url the link or image under the mouse  points to. 

VB
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
    TextBox1.Text = Tabbed_IE1.Linx 'Accesses the public string "Linx". 
End Sub

If you prefer to use your own address bar you can make mine go away by adding this line to your form load event: "Tabbed_IE.Addressbar.dispose()". 

If you want your tabs on the left instead of the top, you can do that in your form load event with this:

VB
Tabbed_IE1.Tabby.Alignment = TabAlignment.Left

There are many more things you can manage with your own code. 

Points of Interest 

I am working on doing the same thing with the Gecko control used by Firefox and Google Chrome.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)