Aug 11, 2009 03:17 PM
(This post was last modified: Jun 22, 2010 08:50 AM by Xch4ng3.)
I made a post a few days ago called "[VB2008][Your 1st program] Web browser"
It was just to teach some beginners some basic stuff to get
them going a bit in Visual Basic 2008.
Well someone said to me "There's plenty of them, Make yours more advanced"
So I did...
This is how to create a Advanced Web Browser in Visual Basic 2008.
[You may download the source at the bottom of the page, Send it out, Use the code, I don't care... Enjoy!]
I want you to do a few things to your form1 as soon as you open a new project.
Do all your basic work such as the properties, the form name, make sure you stretch your form out all the way (It's a web browser), etc.
Add 1 Combobox, 6 buttons or pictures, 1 MenuStrip, 1 ToolStatusStrip, 1 timer.
Go to the bottom of your form you will see your toolstatusstrip.
Click on it and you will see a little box pop up on the side
click that and add a progress bar.
Your form1 should look like this.
[IMG]http://i28.[censored].com/fuqo7k.jpg[/IMG]
&
[IMG]http://i25.[censored].com/2627fi0.jpg[/IMG]
--
Label your buttons or pictures what each one is.
Back, Forward, Refresh, Stop, Home, & the far right button is Go.
Take 1 tab control and make it the same size as your form 1.
It should look like this.
[IMG]http://i27.[censored].com/wb5f2e.jpg[/IMG]
--
Now go to the menu strip and your going to make 3 rows.
1. File 2. Shortcuts 3. About.
In row 1 (File) put 4 options in this order.
Add Tab
Remove Tab
Website Properties
Exit
In row 2 (Shortcuts) put 12 options in this order.
Youtube
Myspace
Hackforums
Facebook
Tagged
Hi5
Bebo
Yahoo
AOL
AIM
Google
Wikipedia
In row 3 (About) your only going to have that row "About"
Do not add options to this.
--
Now lets put some code into our buttons or pictures.
Back button:
Forward Button:
Refresh Button:
Stop Button:
Home Button:
Go Button:
[IMG]http://i25.[censored].com/2qte4xw.jpg[/IMG]
--
Lets put in some code in to MenuStrip now.
Go to the 1st row file and add these codes
File - Add Tab
File - Remove Tab
File - Website Properties
File - Exit
Lets put code into row 2 now (Shortcuts)
Shortcuts - Youtube
Shortcuts - Myspace
Shortcuts - Hackforums
Shortcuts - Google
Shortcuts - Wikipedia
You will get the idea of adding more shortcuts (If you want)
No need for me to put the code in for all of them
Especially since you can download the project at the bottom.
Now row 3 (About)
Double click on "About" and add this code.
--
Now go to your timer1, Add in this code.
--
Now open your code and right under Public Class Form1
Put this whole code.
Then double click on your form1 to get to your Form1_Load
Enter in this code.
It will look like this.
[IMG]http://i28.[censored].com/2uszazb.jpg[/IMG]
Now add your icon, Save your project, Build it.
And now you have an Advanced Web Browser that was coded in
Visual Basic 2008.
Here is the download for the source.
"I uploaded with MediaFire.com which scans files for a virus before uploading it"
It was just to teach some beginners some basic stuff to get
them going a bit in Visual Basic 2008.
Well someone said to me "There's plenty of them, Make yours more advanced"
So I did...
This is how to create a Advanced Web Browser in Visual Basic 2008.
[You may download the source at the bottom of the page, Send it out, Use the code, I don't care... Enjoy!]
I want you to do a few things to your form1 as soon as you open a new project.
Do all your basic work such as the properties, the form name, make sure you stretch your form out all the way (It's a web browser), etc.
Add 1 Combobox, 6 buttons or pictures, 1 MenuStrip, 1 ToolStatusStrip, 1 timer.
Go to the bottom of your form you will see your toolstatusstrip.
Click on it and you will see a little box pop up on the side
click that and add a progress bar.
Your form1 should look like this.
[IMG]http://i28.[censored].com/fuqo7k.jpg[/IMG]
&
[IMG]http://i25.[censored].com/2627fi0.jpg[/IMG]
--
Label your buttons or pictures what each one is.
Back, Forward, Refresh, Stop, Home, & the far right button is Go.
Take 1 tab control and make it the same size as your form 1.
It should look like this.
[IMG]http://i27.[censored].com/wb5f2e.jpg[/IMG]
--
Now go to the menu strip and your going to make 3 rows.
1. File 2. Shortcuts 3. About.
In row 1 (File) put 4 options in this order.
Add Tab
Remove Tab
Website Properties
Exit
In row 2 (Shortcuts) put 12 options in this order.
Youtube
Myspace
Hackforums
Tagged
Hi5
Bebo
Yahoo
AOL
AIM
Wikipedia
In row 3 (About) your only going to have that row "About"
Do not add options to this.
--
Now lets put some code into our buttons or pictures.
Back button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()Forward Button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()Refresh Button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()Stop Button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()Home Button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("hackforums.net")Go Button:
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)[IMG]http://i25.[censored].com/2qte4xw.jpg[/IMG]
--
Lets put in some code in to MenuStrip now.
Go to the 1st row file and add these codes
File - Add Tab
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()File - Remove Tab
Code
If Not TabControl1.TabPages.Count = 1 Then
TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
int = int - 1
End IfFile - Website Properties
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).ShowPropertiesDialog()File - Exit
Code
Me.Close()Lets put code into row 2 now (Shortcuts)
Shortcuts - Youtube
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("www.youtube.com")Shortcuts - Myspace
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("www.myspace.com")Shortcuts - Hackforums
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("hackforums.net")Shortcuts - Google
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("www.google.com")Shortcuts - Wikipedia
Code
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate("www.wikipedia.org")You will get the idea of adding more shortcuts (If you want)
No need for me to put the code in for all of them
Especially since you can download the project at the bottom.
Now row 3 (About)
Double click on "About" and add this code.
--
Now go to your timer1, Add in this code.
Code
Msgbox ("Put the About me of the program in here")Now open your code and right under Public Class Form1
Put this whole code.
Code
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 SubThen double click on your form1 to get to your Form1_Load
Enter in this 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()It will look like this.
[IMG]http://i28.[censored].com/2uszazb.jpg[/IMG]
Now add your icon, Save your project, Build it.
And now you have an Advanced Web Browser that was coded in
Visual Basic 2008.
Here is the download for the source.
"I uploaded with MediaFire.com which scans files for a virus before uploading it"
Code
http://www.mediafire.com/?sharekey=5a00dce134c3035cd8f14848abf485dde04e75f6e8ebb871

![[Image: l8foq.png]](https://i.imgur.com/l8foq.png)