New Webbrowser Advanced - Make it your own - TUT
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
the basics in any web browser is adding a tab control a few buttons for navigation and a text box for the url
so to start of add these things in your web browser add:
1 timer
1 tab control - Make sure you delete all the tabs
9 buttons
and last add a stat strip with 1 label and one progress bar named ToolStripProgressBar1 for the progress bar and
any name for the label
next add this 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
Form1_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()
Add Tab:
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()
Remove Tab:
If Not TabControl1.TabPages.Count = 1 Then
TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
int = int - 1
End If
Website Properties:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).ShowPropertiesDialog
Back:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
Forward:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
Refresh:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()
Stop:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()
Home:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
Go:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
Timer1:
ToolStripStatusLabel1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).StatusText
and you have a semi advanced web browser
for other cool stuff like favicon, history and bookmarks
follow this
for a favicon add a picture box next to the URL text box
in the
after that add this code
note add this code under Private Sub Done don't erase the code already in there put this code under that code
Dim url As Uri = New Uri(textbox1.Text) If url.HostNameType = UriHostNameType.Dns Then Dim iconURL = "http://" & url.Host & "/favicon.ico" Dim request As System.Net.WebRequest = System.Net.HttpWebRequest.Create(iconURL) Dim response As System.Net.HttpWebResponse = request.GetResponse() Dim stream As System.IO.Stream = response.GetResponseStream() Dim favicon = Image.FromStream(stream) Me.PictureBox1.Image = favicon End If
for adding the history add-on follow this:
first go to my project in visual basic
then go to settings and add a item by clicking on settings item in there already and change the name to history
then go to the type and change it to system.collections.specialized.string collection
after that my a new form for the history and add a list box and in the form load type this in
For Each item As String In My.Settings.History
ListBox1.Items.Add(item)
Next
then go to your main form and in the private sub done add this code
My.Settings.History.Add(CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).url.tostring())
My.Settings.Save()
for bookmarks download this
http://www.mediafire.com/?ywjnzjinjym
and there you go thats how to make an advanced web browser if you want to know more stuff about advanced webbrowser or any questions message me at Zelsoft@hotmail.com
so to start of add these things in your web browser add:
1 timer
1 tab control - Make sure you delete all the tabs
9 buttons
and last add a stat strip with 1 label and one progress bar named ToolStripProgressBar1 for the progress bar and
any name for the label
next add this 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
Form1_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()
Add Tab:
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()
Remove Tab:
If Not TabControl1.TabPages.Count = 1 Then
TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
int = int - 1
End If
Website Properties:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).ShowPropertiesDialog
Back:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
Forward:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
Refresh:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()
Stop:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()
Home:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()
Go:
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
Timer1:
ToolStripStatusLabel1.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).StatusText
and you have a semi advanced web browser
for other cool stuff like favicon, history and bookmarks
follow this
for a favicon add a picture box next to the URL text box
in the
after that add this code
note add this code under Private Sub Done don't erase the code already in there put this code under that code
Dim url As Uri = New Uri(textbox1.Text) If url.HostNameType = UriHostNameType.Dns Then Dim iconURL = "http://" & url.Host & "/favicon.ico" Dim request As System.Net.WebRequest = System.Net.HttpWebRequest.Create(iconURL) Dim response As System.Net.HttpWebResponse = request.GetResponse() Dim stream As System.IO.Stream = response.GetResponseStream() Dim favicon = Image.FromStream(stream) Me.PictureBox1.Image = favicon End If
for adding the history add-on follow this:
first go to my project in visual basic
then go to settings and add a item by clicking on settings item in there already and change the name to history
then go to the type and change it to system.collections.specialized.string collection
after that my a new form for the history and add a list box and in the form load type this in
For Each item As String In My.Settings.History
ListBox1.Items.Add(item)
Next
then go to your main form and in the private sub done add this code
My.Settings.History.Add(CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).url.tostring())
My.Settings.Save()
for bookmarks download this
http://www.mediafire.com/?ywjnzjinjym
and there you go thats how to make an advanced web browser if you want to know more stuff about advanced webbrowser or any questions message me at Zelsoft@hotmail.com
- WuSaMi Bringing the Pro in Programmers Once again
sorry to tell you but this has been posted alot before
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

zachman61 wrote:sorry to tell you but this has been posted alot beforeYeah i agree with zach this has been posted/made before. and i don't think that there is anything new in vb.net made webbrowsers. everything has been done on this subject.
Don't take this the wrong way i like "Home made browsers" but try to make it a little more advanced or make a cool interface to it, it doesn't matter if its a simple webbrowser but with a "cool interface" and a few atractive features(Theme change, an HTML PAGE/URL Grabber) you will see that people will see it with another look. This is just an advice not for you but for all of us "Programmers".
(sorry for my bad English I'm Romanian)
You can find me on Facebook or on Skype mihai_92b
And when your making a tutorial, always use "['code'] Codes here ['/code']" remove the ' ' and " "
my web browser is way more advanced i know every thing about making one i have been making web browsers for 2 years now and ive made over 15 different ones so if yu think that i dont know alot about them then ask me any question and i willl answer it i know that not alot of stuff about making them has been posted because i couldn't put it all in here
- WuSaMi Bringing the Pro in Programmers Once again
Zelsoft wrote:my web browser is way more advanced i know every thing about making one i have been making web browsers for 2 years now and ive made over 15 different ones so if yu think that i dont know alot about them then ask me any question and i willl answer it i know that not alot of stuff about making them has been posted because i couldn't put it all in hereHow is it more advanced? Though its tabbed that doesn't mean its advanced.
Agust1337 wrote:lol + the code for the favicon is exactly the same as someone else(im not posting link...)Zelsoft wrote:my web browser is way more advanced i know every thing about making one i have been making web browsers for 2 years now and ive made over 15 different ones so if yu think that i dont know alot about them then ask me any question and i willl answer it i know that not alot of stuff about making them has been posted because i couldn't put it all in hereHow is it more advanced? Though its tabbed that doesn't mean its advanced.
actually , i guess you understand 1/3th of the code "you wrote" if not , tell me what Ctype means 

hm not very advaned and i think it posted b4
YourSocksRoxx wrote:actually , i guess you understand 1/3th of the code "you wrote" if not , tell me what Ctype meansno answer yet...
Copyright Information
Copyright © Codenstuff.com 2020 - 2023