How to Make a Web Browser With Visual Basic

Visual Basic is Microsoft's flagship event-driven programming language. Legacy versions of Visual Basic were used to create programs for the COM programming environment; current releases of the language are fully integrated into the .NET environment. Visual Basic has prebuilt programming modules that allow programmers to incorporate graphical user interfaces into most applications. You can create a basic Web browser with Visual Basic by using the predefined interface components coupled with programming code to handle user interaction with the Web browser.

Instructions

    • 1

      Download Visual Basic 2008 Express Edition (see Resources).

    • 2

      Restart your computer and open Visual Basic Express. Choose "New Project," then "Microsoft Internet Controls," in the Visual Basic toolbar, then "Apply" and finally click "Close."

    • 3

      Choose the icon that was added to the Tools window and draw a large square on the Visual Basic form. This will be the display area for Web pages in the Web browser you are creating. Then insert a text box component by selecting the "Textbox" component from the toolbar and clicking at the top of the form above the box you previously inserted. This will be the Web address entry area of your Web browser.

    • 4

      Insert four buttons on your Web browser form: Go, Forward, Back and Refresh. Click each button and change the label to match its purpose. For example, the "Go" button will be labeled "CmdGo" to indicate it is a command button and the purpose of the button.

    • 5

      Double-click "Go" and then "Back" and enter the following code, which appears in the associated programming dialog box that appears:

      CmdGo
      Private Sub cmdgo_Click()
      WebBrowser1.Navigate (Text1.Text)
      End Sub

      CmdBack
      Private Sub cmdback_Click()
      WebBrowser1.GoBack
      End Sub

    • 6

      Double-click "Forward" and then the main website address text field, and enter the following code, which appears in the associated programming dialog box that appears:

      CmdForward
      Private Sub Cmdforward_Click()
      WebBrowser1.GoForward
      End Sub

      Private Sub Form_Load()
      WebBrowser1.Navigate ("http://www.demandstudios.com")
      End Sub

    • 7

      Double-click the Web page viewing area of your form and enter the following code to display Web pages in your Visual Basic browser:

      Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
      Text1.Text = (WebBrowser1.LocationURL)
      Form1.Caption = (WebBrowser1.LocationName)
      End Sub

    • 8

      Save, run and view your new Visual Basic Web browser.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured