Hello,
I have the following code to dynamically add a tab to a UltraTabControl component:
UltraTab newTab = m_TabCtrl.Tabs.Add();
newTab.Text = title;
newTab.AllowClosing = Infragistics.Win.DefaultableBoolean.True;
newTab.AllowMoving = Infragistics.Win.DefaultableBoolean.True;
newTab.CloseButtonVisibility = Infragistics.Win.UltraWinTabs.TabCloseButtonVisibility.WhenSelectedOrHotTracked;
tabContent.Dock = DockStyle.Fill;
newTab.TabPage.Controls.Add(tabContent);
newTab.Tag = tabContent;
95% of the time, this code runs perfectly fine. 5% of the Time, TabPage is null and an exception is thrown. How can I be certain that the TabPage is created?
Hello johancarlsson,
I was not able to reproduce your scenario so I attached a sample for you to look into and see if it will throw an exception again.
Please do not hesitate to ask if something comes up.