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
945
SelectedTabChanged event
posted

I had the following code in my application to add tab and its associated control:

    m_ultraTabControl.BeginUpdate();
    UltraTab newTab;
    UltraTabsCollection tabs = m_ultraTabControl.Tabs;
    newTab = tabs.Add();
    newTab.TabPage.Controls.Add(myControl);
    newTab.Tag = myObject;
    m_ultraTabControl.SelectedTab = newTab;
    m_ultraTabControl.EndUpdate();

I also subscribed to SelectedTabChanged event. The problem I have is:
1. for the first tab, SelectedTabChanged event fires in line "newTab = tabs.Add();";
2. for the rest of the tabs, the event fires in line "m_ultraTabControl.SelectedTab = newTab;"

Is there a way to stop the first tab firing this event when I do tabs.Add()?

Thanks!