This is the snap shot simple webbrowser develped in vb with basic options
Public Class Form1
002 | Dim URLString As String |
003 | Dim HomeURL As String = "www.bbc.com/football" |
006 | 'This is our own module that causes the browser to naviagate to the link selected elsewhere |
007 | Private Sub GoToURL(ByVal SelectedURL As String) |
008 | wbBrowser.Navigate(SelectedURL) |
009 | If (cbWebsite.FindStringExact(URLString) < 0) And (URLString <> Nothing) Then |
010 | ' if not already in list - add this url to the combobox |
011 | cbWebsite.Items.Add(URLString) |
014 | Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load |
017 | Private Sub lblWebsite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) |
021 | Private Sub btnWebsite_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click |
022 | If cbWebsite.SelectedItem = "" Then |
023 | URLString = cbWebsite.Text |
025 | URLString = cbWebsite.SelectedItem |
029 | Private Sub txtURL_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cbWebsite.KeyDown |
030 | If e.KeyData = Keys.Enter Then ' Instead of pressing GO, it will accept enter on the keyboard ' |
032 | e.SuppressKeyPress = True |
036 | Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click |
040 | Private Sub btnHome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click |
044 | Private Sub btnForward_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click |
045 | WbBrowser.GoForward() |
048 | Private Sub btnGoogle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoogleToolStripMenuItem.Click |
054 | Private Sub btnMsn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MsnToolStripMenuItem.Click |
060 | Private Sub btnAskJeeves_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AskJeevesToolStripMenuItem.Click |
066 | Private Sub WbBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WbBrowser.DocumentCompleted |
067 | lblwebpage.Text = WbBrowser.Url.ToString |
071 | Private Sub StatusStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles StatusStrip1.ItemClicked |
075 | Private Sub WbBrowser_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WbBrowser.ProgressChanged |
076 | prgdownload.Value = (e.CurrentProgress / e.MaximumProgress) * 100 |
080 | Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click |
084 | Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click |
088 | Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click |
089 | Dim Browse As New WebBrowser |
090 | TabControl1.TabPages.Add(1, "Page" & i) |
091 | TabControl1.SelectTab(1 - 1) |
092 | Browse.Name = "WbBrowser" |
093 | Browse.Dock = DockStyle.Fill |
094 | TabControl1.SelectedTab.Controls.Add(Browse) |
098 | Private Sub btnRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemove.Click |
099 | TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex) |
100 | TabControl1.SelectTab(TabControl1.TabPages.Count - 1) |