Lesson 23: Creating a Web Browser
Build your own custom browser with VB2019
Key Takeaway
With VB2019's WebBrowser control, you can create a fully functional web browser in minutes. Customize it to your preferences and add powerful features with minimal code.
Which browser do you use to surf the Internet? Basically, everyone likes to navigate the Internet using Google Chrome, Internet Explorer, FireFox, Safari, Opera and more. However, isn’t it cool if you can create your very own web browser that you can customize to your own taste? Yes, you can do that in Visual Basic 2019, and pretty easy too.
WebBrowser Control
The core component that renders web content
Navigation
Navigate to any URL with a single method call
Browser Actions
Back, forward, refresh and search functionality
Customization
Add your own features and interface elements
23.1 Building the Web Browser
In this lesson, we'll create a simple yet functional web browser. First of all, start a new project and name it with any names you like, we are using the name MyWebBrowser. Change the size of Form1 to 800,600 in its properties window. Next, you need to add an engine so that your web browser can connect to the Internet, and this very engine is the web browser control, located on the Toolbox on the left side, set its size property to 600,400 and change its name to MyWebBrowser.
WebBrowser Control
The WebBrowser control provides the core functionality for rendering web pages. It's built on Internet Explorer's rendering engine and supports most modern web standards.
To use it:
- Open the Toolbox in Visual Studio
- Locate the WebBrowser control under "Common Controls"
- Drag and drop it onto your form
- Set the Dock property to Fill for full-page rendering
23.1(a) Creating the Interface
The next step is to insert a text box and place it at the top of the web browser control, this will be served as the address bar where the user can enter the URL. Next, place a button beside the text box and change its text as GO and change its name to BtnGo. Finally, add a few more buttons and change their texts to Home, Back, Forward, Refresh and Search respectively.

Figure 23.1: Web browser interface with navigation controls
23.1(b) Browser Navigation Methods
The WebBrowser control comprises various methods like GoHome, GoBack, GoForward, Search, Refresh, Navigate and more. They can be used to write event-driven procedures for the various navigation buttons we place on the web browser.
Method | Description |
---|---|
Navigate(url) | Loads the document at the specified URL |
GoBack() | Navigates to the previous page in history |
GoForward() | Navigates to the next page in history |
Refresh() | Reloads the current document |
GoHome() | Navigates to the user's home page |
GoSearch() | Navigates to the user's search page |
For the Navigate method, we use the following syntax:
23.1(c) The Browser Code
Here's the complete code to implement the browser functionality:
Public Class Form1 Private Sub BtnGO_Click(sender As Object, e As EventArgs) Handles BtnGO.Click ' Navigate to the URL entered in the address bar MyWebBrowser.Navigate(TxtURL.Text) End Sub Private Sub BtnSearch_Click(sender As Object, e As EventArgs) Handles BtnSearch.Click ' Navigate to the default search page MyWebBrowser.GoSearch() End Sub Private Sub BtnHome_Click(sender As Object, e As EventArgs) Handles BtnHome.Click ' Navigate to the home page MyWebBrowser.GoHome() End Sub Private Sub BtnBack_Click(sender As Object, e As EventArgs) Handles BtnBack.Click ' Go back to the previous page MyWebBrowser.GoBack() End Sub Private Sub BtnForward_Click(sender As Object, e As EventArgs) Handles BtnForward.Click ' Go forward to the next page MyWebBrowser.GoForward() End Sub Private Sub BtnRefresh_Click(sender As Object, e As EventArgs) Handles BtnRefresh.Click ' Refresh the current page MyWebBrowser.Refresh() End Sub End Class
Enhancing Your Browser
Once you have the basic browser working, you can enhance it with additional features:
- Status Bar: Add a status bar to show loading progress
- Bookmarks: Implement a bookmark system for favorite sites
- Tabbed Browsing: Create a multi-tab browsing experience
- History: Maintain a history of visited sites
- Download Manager: Add functionality to download files
These features can be implemented using additional controls and leveraging the WebBrowser control's events and properties.
Lesson Summary
In this lesson, you've learned how to create a functional web browser in VB2019:
WebBrowser Control
Implemented the core web rendering component
Navigation Methods
Used GoBack, GoForward, Refresh and Navigate methods
User Interface
Created a browser interface with address bar and navigation buttons
Customization
Learned how to extend the browser with additional features
Creating a web browser is a great way to understand how web technologies work. In the next lesson, we'll explore error handling techniques in VB2019.
Next Lesson
Learn how to handle errors gracefully in Lesson 24: Error Handling.
Related Resources

Visual Basic 2019 Made Easy
Unlock the power of Visual Basic 2019 with this comprehensive, easy-to-follow handbook written by Dr. Liew, renowned educator and founder of the popular programming tutorial website VBtutor.net. Whether you're new to programming or brushing up your skills, this book is your perfect companion to learn Visual Basic 2019 from the ground up.
What You'll Learn:
- Understand Core Programming Concepts: Grasp the foundational principles of Visual Basic 2019, including variables, data types, conditional logic, loops, and event-driven programming.
- Develop Real Windows Desktop Applications: Build fully functional and interactive Windows apps using Visual Studio 2019—guided through step-by-step tutorials.
- Apply Dozens of Ready-to-Use Examples: Explore a rich collection of practical sample programs, from basic calculators to image viewers and database applications.
- Adapt and Reuse Code for Your Own Projects: Customize professionally written code snippets to speed up your development process and bring your ideas to life.
- Package and Deploy Like a Pro: Learn how to compile, test, and distribute your Visual Basic applications seamlessly with built-in deployment tools.

Visual Basic Programming With Code Examples
Visual Basic Programming with Code Examples offers a unique dual-format approach, showcasing sample codes in both Visual Basic 6 (VB6) and VB.NET. This side-by-side presentation helps you understand the evolution of Visual Basic and empowers you to work confidently across both environments.
What You'll Learn:
- Core Concepts Made Easy: Explore data types, control structures, file handling, procedures, user interface design, and more.
- Hands-On Application Building: Design real-world applications, including financial calculators, educational tools, games, multimedia apps, and database systems.
- 48 Practical Code Examples: Study and customize fully explained programs that illustrate key programming techniques.
- Dual-Code Format: Learn to translate and adapt code between VB6 and VB.NET seamlessly.