Adblock breaks this site

Tab Control Add webbrowser (Code, tut)

Discussion in 'Programming General' started by kharg0, Feb 5, 2008.

  1. kharg0

    kharg0 Active Member

    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0
    Tab Control Add webbrowser (Code, tut)

    at the begining state...

    Code:
    Public Class (form name here)
    dim tab as new tabpage
    dim theweb as new webbrowser
    add this to your buttons, also for this code u need a tab control...

    Code:
    if TabControl1.SelectedTab Is TabPage1 Then WebBrowser1.Navigate(ComboBox1.Text)
            If TabControl1.SelectedTab Is Tab Then MyWeb.Navigate(ComboBox1.Text)
    make an add tab button.. this is the code for it...

    Code:
    Dim i As Integer
            Tab.Parent = TabControl1
            i = TabControl1.TabCount - 1
            theWeb.Parent = tab
            theWeb.Visible = True
            theWeb.Dock = DockStyle.Fill
            theWeb.GoHome()

    thx tell me what u think...
     
  2. darkkid714

    darkkid714 Guest

    Referrals:
    0
    Tab Control Add webbrowser (Code, tut)

    Seems great but you didt really explain what to start with. I have no idea where I put the second code. All cred due this is what I need. But its a bit vague. You have a combo box in there but what the hell is the combo box for. Its really confusing.
     
  3. Elkins121

    Elkins121 Member

    Joined:
    Sep 18, 2007
    Posts:
    63
    Referrals:
    0
    Sythe Gold:
    0
    Tab Control Add webbrowser (Code, tut)

    Well, I understand him..you put the second code on the Add Tab button's "Click" procedure. The combo box is where you type in the web address.
     
  4. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Tab Control Add webbrowser (Code, tut)

    Darkkid, I recommend you buy a book and read up. Some times you shouldn't have to be told where to put things to know where to put them.

    For example, if I told you to make a messagebox after the user clicked a button, most likely the first thing you would do is go to the Button's click event, wouldn't you?

    It is amazingly simple to do this if you've migrated from a language such as VB6 where there is next to no object-orientation, wouldn't you agree? I don't code either, but I work with .Net (C#, etc) quite often, so I can make sense of your code quite thoroughly.

    Edit: Sorry I forgot to comment.

    Its nice and simple, and simple is the way things should be.
     
  5. Original VB

    Original VB Guest

    Referrals:
    0
    Tab Control Add webbrowser (Code, tut)

    Wow, thanks the tab part helped I couldn't figure out how to get it working =D thank you very much.
     
  6. The True Gears

    The True Gears Guest
    $5 USD Donor

    Referrals:
    1
    Tab Control Add webbrowser (Code, tut)

    This is what i had for mine

    Code:
    Dim browse As New WebBrowser
            TabControl1.TabPages.Add(i, "Page " & i)
            TabControl1.SelectTab(i - 1)
            browse.Name = "vb"
            browse.Dock = DockStyle.Fill
            TabControl1.SelectedTab.Controls.Add(browse)
            i = i + 1
    And code like this for other buttons

    Code:
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoForward()
    CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).GoBack()
    Ect.
     
< One dimensional array | AutoMe Test - How good are you at cheating? >


 
 
Adblock breaks this site