How to make an advanced webbrowser
Ok. In this Thread, I will show you how to create an advanced web browser that includes
*Tab
*File>Add Tab>Remove Tab>Website Properties>Exit
*Back
*Forward
*Refresh
*Stop
*Home
*Go
*A Progress Bar
*etc...
&The Good Part is, is its fast. Faster than IE!!! Well. Atleast mine
&
*FIRST. Sorry. Forgot to put this in.*
Ok. Double click Form1. THE FIRST. Code you need to put in there. Is this:
So. Like the code should look like this, but DONT put this in. Put the code above in:
Add A MenuStrip Make the First Tab "File"
Then Add one that says
"Add Tab"
"Remove Tab"
"Website Properties"
"Exit"
Now, Add 6 Buttons.
Make there text the following:
Button 1:Back
Button 2:Forward
Button 3:Refresh
Button 4:Stop
Button 5:Home
Button 6:Go
********************************************
Click File. And then Double click Add Tab.
Enter this code:
Ok. Now your done with that. Then click Remove Tab. And enter the following code:
Ok. NOW. Ur done with that... Lol. Still more.
Click Website Properties, Add the following code:
Ok. And this next code is SOO SIMPLE!! Click Exit and enter the following:
But make sure the word: End is aligned with the other codes.
Ok. Now add a Tab Control.
Make it as big as you want to be able to see the website screen. So like. If your on a website. Make it as big as you want.
Oh ya. Make a StatusStrip.
Put it on the bottom. Make sure you DONT change the name. And add a ProgressBar And put it after the word "ToolStripStatus1"
And when you add the Tab Control, go to Properties, and Under TabPages, Delete ALL. Of. Them.
Now time for the buttons to make the browser go (Back, Forward, Refresh, Stop, Home, Go)
Ok. Double click Back and add the following code:
Ok. Double click Forward And add the following code:
Ok. Double click Refresh And add the following code:
Ok. Double click Stop and enter the following code:
Ok. Double click Home and enter the following code:
Ok. Double click Go and enter the following code:
Ok. LOL. Wow. Lots.
PHEW!! NOW.. Add a Timer.
Add this code:
Now add a ComboBox.
Put the combo box in between "Home" and "Go", well thats where I put it. Cuz thats where it would normally be.
Now. The SOURCE code. Double click Form1 And enter the following code:
Ok. After all this trouble. The final code should look like this:
__________________________________________________ _____
There. Ok. Well. Did I forget something? Problems? Suggestions? Improvements? PM me. Did this work 100% for you? Please thank me
Crossfire player? Add me. [E]lite-*Boi. Now, your free to edit background, add features. You wanna put your name and what website it came from (Of course, MPGH.net) If ppl are going to leech from you. Please, post results! Cant wait!!!
*Tab
*File>Add Tab>Remove Tab>Website Properties>Exit
*Back
*Forward
*Refresh
*Stop
*Home
*Go
*A Progress Bar
*etc...
&The Good Part is, is its fast. Faster than IE!!! Well. Atleast mine
&*FIRST. Sorry. Forgot to put this in.*
Ok. Double click Form1. THE FIRST. Code you need to put in there. Is this:
Code:
Dim int As Integer = 0
Code:
Public Class Form1
Dim int As Integer = 0
Then Add one that says
"Add Tab"
"Remove Tab"
"Website Properties"
"Exit"
Now, Add 6 Buttons.
Make there text the following:
Button 1:Back
Button 2:Forward
Button 3:Refresh
Button 4:Stop
Button 5:Home
Button 6:Go
********************************************
Click File. And then Double click Add Tab.
Enter this code:
Code:
Dim Browser As New WebBrowser
TabControl1.TabPages.Add("New Page")
TabControl1.SelectTab(int)
Browser.Name = "Web Browser"
Browser.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(Browser)
AddHandler Browser.ProgressChanged, AddressOf Loading
AddHandler Browser.DocumentCompleted, AddressOf Done
int = int + 1
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
Code:
If Not TabControl1.TabPages.Count = 1 Then
TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
int = int - 1
End If
Click Website Properties, Add the following code:
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).ShowPropertiesDialog()
Code:
End
Ok. Now add a Tab Control.
Make it as big as you want to be able to see the website screen. So like. If your on a website. Make it as big as you want.
Oh ya. Make a StatusStrip.
Put it on the bottom. Make sure you DONT change the name. And add a ProgressBar And put it after the word "ToolStripStatus1"
And when you add the Tab Control, go to Properties, and Under TabPages, Delete ALL. Of. Them.
Now time for the buttons to make the browser go (Back, Forward, Refresh, Stop, Home, Go)
Ok. Double click Back and add the following code:
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
Ok. Double click Go and enter the following code:
Code:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
PHEW!! NOW.. Add a Timer.
Add this code:
Code:
ToolStripStatusLabel1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).StatusText
Put the combo box in between "Home" and "Go", well thats where I put it. Cuz thats where it would normally be.
Now. The SOURCE code. Double click Form1 And enter the following code:
Code:
Dim Browser As New WebBrowser
TabControl1.TabPages.Add("New Page")
Browser.Name = "Web Browser"
Browser.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(Browser)
AddHandler Browser.ProgressChanged, AddressOf Loading
AddHandler Browser.DocumentCompleted, AddressOf Done
int = int + 1
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
Code:
Public Class Form1
Dim int As Integer = 0
Private Sub Loading(ByVal sender As Object, ByVal e As Windows.Forms.WebBrowserProgressChangedEventArgs)
ToolStripProgressBar1.Maximum = e.MaximumProgress
ToolStripProgressBar1.Value = e.CurrentProgress
End Sub
Private Sub Done(ByVal sender As Object, ByVal e As Windows.Forms.WebBrowserDocumentCompletedEventArgs)
TabControl1.SelectedTab.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle
ComboBox1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Url.ToString
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Browser As New WebBrowser
TabControl1.TabPages.Add("New Page")
Browser.Name = "Web Browser"
Browser.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(Browser)
AddHandler Browser.ProgressChanged, AddressOf Loading
AddHandler Browser.DocumentCompleted, AddressOf Done
int = int + 1
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
End Sub
Private Sub AddTabToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddTabToolStripMenuItem.Click
Dim Browser As New WebBrowser
TabControl1.TabPages.Add("New Page")
TabControl1.SelectTab(int)
Browser.Name = "Web Browser"
Browser.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(Browser)
AddHandler Browser.ProgressChanged, AddressOf Loading
AddHandler Browser.DocumentCompleted, AddressOf Done
int = int + 1
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
End Sub
Private Sub RemoveTabToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveTabToolStripMenuItem.Click
If Not TabControl1.TabPages.Count = 1 Then
TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
int = int - 1
End If
End Sub
Private Sub WebsitePropertiesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WebsitePropertiesToolStripMenuItem.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).ShowPropertiesDialog()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ToolStripStatusLabel1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).StatusText
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
End Class
There. Ok. Well. Did I forget something? Problems? Suggestions? Improvements? PM me. Did this work 100% for you? Please thank me

Crossfire player? Add me. [E]lite-*Boi. Now, your free to edit background, add features. You wanna put your name and what website it came from (Of course, MPGH.net) If ppl are going to leech from you. Please, post results! Cant wait!!!
Why isnt anyone posting?


