MDI Deactivate

I would like to prompt the user to save before switching from one tab to another in my application. The Deactivate() function fires too late. Is there something that can be done to achieve similar functionality to the Closing() function, but when the user switches tabs?

1 Reply

MJ Mano J Syncfusion Team August 2, 2006 06:56 PM UTC

Hi,

I suppose you are using TabbedMDIManager in your application. You can use the cancellable SelectedIndexChanging event of internal tabControlAdv used in tabbedMDIManager for this purpose.

tabbedMDIManager.TabControlAdded += new TabbedMDITabControlEventHandler(tabbedMDIManager_TabControlAdded);

private void tabbedMDIManager_TabControlAdded(object sender, TabbedMDITabControlEventArgs args)
{
args.TabControl.SelectedIndexChanging += new SelectedIndexChangingEventHandler(TabControl_SelectedIndexChanging);
}

private void TabControl_SelectedIndexChanging(object sender, SelectedIndexChangingEventArgs args)
{
// Check whether the selected tab needs to be saved here.
}

Please let me know if this meets your requirements.

Regards,
Mano

Loader.
Up arrow icon