954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

adding tabs

0
By choover12 on Sep 19th, 2010 8:16 pm

you can do this

dim i as integer = 0
Public Sub Addtab()
        Dim browser As New webbrowser
        browser.Dock = DockStyle.Fill
        'docking it
        browser.ContextMenuStrip = main.cms
        'adding a context menustip to it
        Dim tab As New TabPage
        tab.Controls.Add(browser)
        main.Tabs.TabPages.Add(tab)
        'IMPORTANT you must select the tab
        main.Tabs.Select(i)
        i += 1

    End Sub


well you don't just have to add browsers, you can do this

dim i as integer = 0
public sub addtab()
dim yourvariable as system.windows.forms.object 'name your variable and tell it your object
yourvariable.dock = dockstyle.fill 'everything has a dock
yourvariable.name = "yourname" 'everything has a name
'this way seems the easiest for me
dim tab as tabpage
tab.controls.add(object)
tabcontrol1.tabpages.add(tab)
tabcontrol1.selecttab(i)
i += 1
end sub
here is how to add tabs

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: