Josiah Horton
Josiah Horton

Reputation: 36

How can I display the contents windows Form in a DotNetBar SuperTabControl tab page?

I've been working with the DotNetBar objects and controls to redesign my web browser's UI and functionality in VB.NET. (I've been using Visual Studio 2012 just in case that's pertinent or helpful.) I wanted to use the SuperTabControl for my tab control because it allows the placement of buttons inside the tab bar much like the new tab buttons found in major web browsers such as Google Chrome, Mozilla Firefox, Internet Explorer and many others. I went to code this button to create a new SuperTabItem and that was not difficult;

SuperTabControl1.Tabs.Add(New SuperTabItem)

The problem i have is trying to create a new SuperTabItem that contains the same content as another Windows Form in my project. I've been abel to do this successfully with the normal windows TabControl and the DotNetBar TabControl but the SuperTabControl will not render the objects in the SuperTabControlPanel. This is the code that I've been trying to use;

Dim t As BaseItem = SuperTabControl1.CreateTab("New Tab")
        Dim panel As SuperTabControlPanel = DirectCast(t.ContainerControl, SuperTabControlPanel)
        Dim newtab As New Tab
        newtab.Show()
        newtab.TopLevel = False
        newtab.Dock = DockStyle.Fill
        panel.Controls.Add(newtab)
        SuperTabControl1.Tabs.Add(t)

This code displays no errors in the code editor but will interrupt my program when the button is clicked and will then stop debugging. I would appreciate any help towards fixing this problem and getting my new tab button to function correctly.

Upvotes: 0

Views: 1070

Answers (1)

Try This

Dim t As SuperTabItem= SuperTabControl1.CreateTab("New Tab")

Upvotes: -1

Related Questions