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!

Parents
No Data
Reply
  • 5389
    posted

    Mike2008,

    I haven't been able to reproduce the behavior you are describing; I've added the code you are using into a Button Click and am only noticing the UltraTabControl's SelectedTabChanged event firing once, when setting its SelectedTab property.  I've attached the sample I was using to test; let me know if there is a difference between the sample and what you are doing.

    ~Kim~

    WinTabsSelectedTabChanged.zip
Children