How To Make An Advanced Webbrowser In Visual Basic 2008

preview_player
Показать описание
Visual Basic 2008 - Advanced Webbrowser. Just decided to remake my video on a very advanced web browser with: Deafult features, Tabs, Progressbar, Status Label ect. You can download the source code from:
Or you can copy + Paste the codes:

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
Рекомендации по теме
Комментарии
Автор

thanks man you dont even know how much this helped me....i am a subscriber and i was wonderin were ya been cuz u aint made no tuts in a while.. u should make some more cuz ur good

DJKBEATS
Автор

I had absolutely no problems with these codes, all worked perfectly, just need to find out how to do History and Bookmarks now :)

xMaXPwrx
Автор

Ah, there we go. Found out how to open it.

Thanks for the tutorial, this is a pretty decent browser you shown us how to make right here.

SnowyNowak
Автор

Turns out you have to convert Webbrowser to
Windows.Forms.Webbrowser.
Looks sick!
Thanks again

dougjarvis
Автор

Very nice tutorial.
I just started learning how to use VB ( i literally just started using it today)
This is the best tutorial i have come upon for a web browser =)

I need to find one on how to do bookmarks.. and other things like that...
Anyway.
Nice tutorial!
I added some things, and took out some, but still good tut. =) 5/5

koolaidblaze
Автор

Thought it took me sometime but it was really great tuts... worth 5 stars wish you to go ahead !

burtugey
Автор

THANKS MAN. This tutorial and it's uploader rocks!

MJVelascoSalvador
Автор

Because there are some spaces in the code form the description. When you put the code in just find the spaces where the words are underlined and delete them.
This is due to youtubes layout.

Thunder
Автор

Great video.
A real big help on a school project.
Awesome tutorial.

dougjarvis
Автор

youre awsome with the most advanced videos out there

sigmaboy
Автор

@Zariack theres an option in the properties menu called "FormBorderStyle" make sure this is set to sizeable

XimontageiX
Автор

@ZooOfFailure
First, click on your browser control in the designer. Then find the "Anchor" property in the "Properties" window. Then click on both white rectangles in the pop-up to make the browser resize when you resize the entire window.

lanman
Автор

Hey thanks, it works, and when I finished your steps, I had some "exception" error, but I downloaded your file and repasted the whole code, fixed it, and so I probably did something wrong there :P

phamily-tv
Автор

i m getting error
Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Documents and Settings\jash\Local Settings\Application Data\Temporary Projects\tech search\Form1.vb 26 115 tech search
please some one help

jashv
Автор

all the code given is correct, but when you paste it to the builder, some unnecessary "-"'s appear where they shouldn't....so go through the code and pick out little things that shouldn't be as



I-tem should be Item...and they appear all over the code so go through and pick out the -'s AFTER pasting it in the builder

napsterpat
Автор

@MarFur93 It doesn't matter. Try creating a conditional If statement that if the value of e.CurrentProgress is at or falls below 0, set the value of the ProgressBar to 0. Otherwise, just keep it as-is.

If e.CurrentProgress<=0 Then
ToolStripProgressBar1.Value = 0
Else
ToolStripProgressBar1.Value = e.CurrentProgress
End If

cldream
Автор

Amazing! It worked! Now i can share my Professional Web Browser Titled:

High Speed

joshuaaragon
Автор

this video helped me so much i came back just to rate it five stars agin :D

destruction
Автор

couple of questions
1)can i download things?
2)can i install toolbars like google toolbar?
3)can i make it look cool like change the color and things like that?
4)is it like a program? you know like when you download firefox
sorry for the many questions im a noob n_n

PacManPalafox
Автор

@TostiEr1k You have to create a Resize event subroutine for the form. I'm not sure if there's a quick and dirty way to calculate the correct sizes and positions, but from what I usually do, I just look at the properties of each control and subtract that from the size of the form, and you get a number to use to subtract that number from whatever the form size is, and will properly display the components.

cldream