Dear community,
In the code sample of the help topic about the TabClosing() event is the following code
if (e.Tab.SettingsResolved.TabCloseAction == MdiTabCloseAction.Close) { if (e.Tab.Form is EditForm) { if (! ((EditForm)e.Tab.Form).Save() ) e.Cancel = true; } }
I wonder what the TabCloseAction is for? Why that comparison with MdiTabCloseAction.Close?
Best regards, Gerald
All right. Thanks, Mike.
Regards, Gerald
On the SettingsResolved, the TabCloseAction can have the values None, Hide, or Close. These indicate what will happen to the Form on the tab when the tab is closed. None indicates the Form and tab will remain open. Hide indicates the Form and tab will be hidden, but can be shown again later. However, Close indicates the Form will be closed, so in the code snippet above, if the Form would be closing, the code asks the user if they want to save the form before closing.