55
Add tab to UltraTabControl
posted

Hi,

I have an UltraTabControl. I am having difficulty adding tabs to the UltraTabControl that have been created previously.

As a quick example, on load of my application I create 5 UltraTabs and save them into a List. After clicking a button on the MainForm, all 5 tabs are then added to the UltraTabControl.

When I load the tabs into the list it looks like this:

var tab = ultraTabControl1.Tabs.Add();

tab.TabPage.Controls.Add(new Label());

cachedTabs.Add(tab);

And when I load the tabs into the UltraTabControl it looks like this:

foreach (var tab in cachedTabs)

{

ultraTabControl1.Tabs.Add(tab);

}

 The tabs themselves appear to get added but the TabPages don't seem to carry over. Any help would be greatly appreciated!

  • 6060
    Offline posted

    Hello Mark,

    Thank you for posting on our forums. 

    To resolve this, you can add the contents of the tab page to a panel and then create a List of these panels and then add them to the TabControl's TabPages. However, adding the tabs from a List to a TabControl will not work. 

    Once you save the Tabs they will not be available to carry over and you cannot add them this way. Please try the above suggestion and let me know if you have any questions.