Bohunt.Org Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Bohunt.Org Forum Community


    Tabbed Web-Browser & Advanced Web-Browser

    Sawybean125
    Sawybean125
    HeuTeck
    HeuTeck


    Male
    Number of posts : 34
    Registration date : 2009-01-20

    Tabbed Web-Browser & Advanced Web-Browser Empty Tabbed Web-Browser & Advanced Web-Browser

    Post  Sawybean125 Mon Feb 02, 2009 4:04 am

    Ok, So This Bit Is For The Tabbed Web-Browser.
    This Is The Most Difficult Bit, But Because i Gibe You The Hole Code It Should Be Easy.
    I Had To Gather Lots Of Bits From Differant Places.
    Soon I Will Have Video Tutorials On Bohunt.Org Youtube Acount.

    First Of Open Visual Basic. IM Gonna Start From Scratch Not Build On The Other One Because Its Easier That Way.

    Then Add A Tab Control
    4 Buttons
    1 ComboBox
    A Menu Strip
    And If You Want A Status Strip.
    On The Menu Strip Add A New Button Called "File" And Under That, Add 2 Call Them "New Tab" And "Close Tab"

    Next You Can Arrange Them How You Want But This Is The Difficult Bit,
    The Codeing.
    On The New Tab Button Add This Code
    Code:
    Dim browse As New WebBrowser
            TabControl1.TabPages.Add(i, "page " & i)
            TabControl1.SelectTab(i - 1)
            browse.Name = "New Tab"
            browse.Dock = DockStyle.Fill
            AddHandler browse.DocumentCompleted, AddressOf browse_done
            TabControl1.SelectedTab.Controls.Add(browse)
            i = i + 1
            CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
    This Is Telling The Program That The Tab Control Is A WebBrowser And Every Time You Add A Tab It Adds A Tab For You.
    Next Double Click On The Form And Put This Code
    Code:
    Dim browse As New WebBrowser
            TabControl1.TabPages.Add(i, "page " & i)
            TabControl1.SelectTab(i - 1)
            browse.Name = "New Tab"
            browse.Dock = DockStyle.Fill
            AddHandler browse.DocumentCompleted, AddressOf browse_done
            TabControl1.SelectedTab.Controls.Add(browse)
            i = i + 1
            CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
    This Also Includes The Nameing Of The Tab Page.

    Next We Need To Code The Button This Is More Difficult Compared To The Basic WebBrowser Because It Is A Tab Control.
    Any Way Double Click On The Go Button And Type This Code In:
    Code:
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(ComboBox1.Text)
    For The Back Button Its Is This Code:
    Code:
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
    Forward Code:
    Code:
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
    Refresh Code:
    Code:
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Refresh()
    That Is Pretty Much It Really.
    For Close Tab It Is This Code:
    Code:
    TabControl1.TabPages.RemoveAt(TabControl1.SelectedIndex)
    i = i - 1
    And Exit Button Is Good Under File Put "Exit"
    And Put This Code:
    Code:
    Me.close
    And That Is It If There Are Any Problems Then Just Reply And Tell Me.
    Also Check Out The Youtube Acount For When I Have Got Some Video Tutorials Up.
    Thanks,
    HeuTeck

      Current date/time is Tue Nov 05, 2024 8:02 pm