We are using TabControl instead of TabbedMdiManager now, and TabControl is embedded inside a custom Control (instead of a Form).
There are some problem with the TabClosing event.It is fine when i close an individual tab, and this event is fired by the TabCotnrol.However, when i tried to close Form (which has the custom control), the TabClosing event is not called on each individual tab.
Compared to the TabbedMdiManager, when a Form's OnClosing event is fired, MdiTab.OnMdiChildClosing is fired, and Closing event on each tab is fired. I can write my own event handler for closing each tab.
How can I achieve this when using TabControl? What is the equivelant of Closing event on a Control instead of a Form?
Thanks.
This is correct behavior. The TabClosing event is only fired on a tab when the tab is closed. When the Form is closed, the tabs are not individually closed. Mdi parent forms had extra code to hide their children before they closed and that is why you were able to use this approach with the UltraTabbedMdiManager. You can get the same effect by manually closing or verifying each tab in the Form's FormClosing event. If any tab is not verified, you can cancel the event.