Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
680
Adding tab to UltraTabControl - TabPage = null
posted

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?