Hack Forums
[.NET] Visual Basic Advanced Webrowser Detailed Tut - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Visual Basic Advanced Webrowser Detailed Tut (/showthread.php?tid=572884)



Visual Basic Advanced Webrowser Detailed Tut - ryanwan1 - Jul 28, 2010

Hi, Welcome To Ma Second Tutorial On VB
This Time I'll Be Showing You How To Make An Advanced Webrowser
(there have been hundreds of browser tuts but i'm going to make a more detailed one)
Okay First Off Open A New Windows Form
  • Name It Browser Or Whatever

  • First Off Add A Tab Control

  • On Tab Pages Remove All Of The Pages

  • Dock The Tab Control To Whateva Yuu Wont

  • Now A Status Bar

  • In The Status Bar Add A Progress Bar And A Label
    Now Add This Code :
    Code
    Private Sub Loading(ByVal sender As Object, ByVal e As Windows.Forms.WebBrowserProgressChangedEventArgs)
            ToolStripProgressBar1.Maximum = e.MaximumProgress
            ToolStripProgressBar1.Value = e.CurrentProgress
        End Sub

    And :
    Code
    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

  • At The Very Top Of The Code Page Just After "public class web_browser"
    add This Code :
    Code
    Dim int As Integer = 0


  • Now Add A Menu Strip

  • Add A List Item Named "File"

  • Now In The File Menu Add "exit"

  • The Code For "exit" :
    Code
    Me.Close [simple]

  • Now Add "Tabs" To The Menu Strip

  • Then Add "New Tab" And "Close Tab"
    Code For New 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()

    Code For Close Tab :
    Code
    If Not TabControl1.TabPages.Count = 1 Then
                TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
                TabControl1.SelectTab(TabControl1.TabPages.Count - 1)
                int = int - 1

  • Now Add 5 Buttons

  • Name Them "Back, Forward, Home, Stop, Refresh

  • Now For The Code
    Back :
    Code
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()

    Forward :
    Code
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()

    Home :
    Code
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoHome()

    Stop :
    Code
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()

    Refresh :
    Code
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()

    And Your Done, You Can Style The Form As You Like#
    [If I Missed Anything Please Let Me Know]





* - 50GTB - Jul 28, 2010

How many web browsers source code are posted in HF
loads topics


* - South Park - Jul 28, 2010

Drags web browser control over to form1

"OMG BRO I MADE A WEB BROWSER"

No.


* - enacje - Jul 28, 2010

(Jul 28, 2010 01:44 PM)Brutal™ Wrote:  How many web browsers source code are posted in HF
loads topics

how many notepads are posted in HF
loads topics


* - *Nemesis* - Jul 28, 2010

(Jul 28, 2010 01:44 PM)Brutal™ Wrote:  How many web browsers source code are posted in HF
(Jul 28, 2010 01:46 PM)M0D3RN H4X3R 1™ Wrote:  *Drags web browser control over to form1*
"OMG BRO I MADE A WEB BROWSER"
No.

You guys are mean...it's clearly a tutorial for beginners and he lost time typing it...
I don't see this negativity when someone copy paste a keylogger src and call it tutorial..

Good job ryan!!


* - Entrepreneur - Jul 28, 2010

It has been posted many times.
Its not really a advanced browser anyway, its a web browser control OMG.


* - Charny - Jul 28, 2010

(Jul 28, 2010 02:10 PM)enacje Wrote:  how many notepads are posted in HF
loads topics

Ah, that's what I was going to post.

OT : That's a nice tutorial for the beginners 👍!


* - ryanwan1 - Jul 28, 2010

(Jul 28, 2010 01:46 PM)M0D3RN H4X3R 1™ Wrote:  *Drags web browser control over to form1*

"OMG BRO I MADE A WEB BROWSER"

No.

thats the gay way m8 :))
its a tab control


(Jul 28, 2010 02:14 PM)Monetizing Kid Wrote:  It has been posted many times.
Its not really a advanced browser anyway, its a web browser control OMG.

your the one who actually pays for a forum site :))

just huvto say laffed at

its a forum site cmon

im jsst dion ths to waste time


* - Camf ∆ - Sep 18, 2011

Good post! Thanks I'm using this as a base for my browser 👍


* - Sol Yurick - Sep 18, 2011

(Sep 18, 2011 03:00 AM)camf Wrote:  Good post! Thanks I'm using this as a base for my browser 👍

Why would you bring an old post back from July?