I have a form with views that appear as tabs. One of the views will not close no matter what I do. All it does is clear the contents of the tab, but the empty tab remains open. I've tried the Close and Dispose method on the tab, but nothing happens.
this.tabbedMdiManager.TabGroups[0].Tabs[iChildIndex].Close(); this.tabbedMdiManager.TabGroups[0].Tabs[iChildIndex].Dispose();
Hello Sam,
I have tested closing tabs programatically and I have been unable to reproduce the behavior described.
What version of our components are you using?
Also, I have attached the sample I used, so if you could please take a look at it, modify it so the issue is present and send it back, and I will take a further look at it.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
MDICloseTabs.zip
18.2.9
Does the issue reproduce with the sample I have sent as well on your end?
My guess is that you are handling an event that is cancelling the close of the form. It could be the Form_Closing event on the form itself. This seems particularly likely since you said it only happens with "one of the views". I assume that means one particular form in your application.
it could also be the TabClosing event of the UltraTabbedMdiManager.If you are setting e.Cancel to true in either of those events, that would explain why the tab will not close.
Yes, your demo works.
I found that the tabs remain in the this.tabbedMdiManager.TabGroups[0].Tabs collection. How do I completely remove a tab from this collection?
Also, I did not click on your button, I clicked on the X on each tab window. Your button just closes the 0 index tab and doesn't close the tab that you're clicking the button on.