Version

TabClosed Event

Event that occurs after an MdiTab is closed.
Syntax
'Declaration
 
Public Event TabClosed As MdiTabEventHandler
public event MdiTabEventHandler TabClosed
Event Data

The event handler receives an argument of type MdiTabEventArgs containing data related to this event. The following MdiTabEventArgs properties provide information specific to this event.

PropertyDescription
Tab Returns the associated MdiTab
Remarks

The TabClosed event is invoked when MdiTab.Close method is invoked, the close button is pressed or the "Close" menu option in the tab's context menu is selected after the action specified in the MdiTabSettingsResolved.TabCloseAction is taken.

Example
The following sample demonstrates how to use the information passed to the TabClosed event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub ultraTabbedMdiManager1_TabClosed(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs) Handles ultraTabbedMdiManager1.TabClosed
    ' The 'TabClosed' event is invoked after the resolved 
    ' TabCloseAction has been performed either via the 
    ' ui (close button or close menu item) or by calling
    ' the Close method of the tab. Depending upon the 
    ' TabCloseAction, the tab may no longer be associated 
    ' with the UltraTabbedMdiManager.
    '

    ' The tab will no longer be associated with the form if it was 
    ' closed.
    If e.Tab.Form Is Nothing Then
        Return
    End If

    ' If the TabCloseAction resolves to None, then no action is
    ' taken on the tab or associated form so you can perform
    ' some custom action.
    If e.Tab.SettingsResolved.TabCloseAction = MdiTabCloseAction.None Then
        ' Perform custom action when a close occurs...
    End If
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void ultraTabbedMdiManager1_TabClosed(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
{
	// The 'TabClosed' event is invoked after the resolved 
	// TabCloseAction has been performed either via the 
	// ui (close button or close menu item) or by calling
	// the Close method of the tab. Depending upon the 
	// TabCloseAction, the tab may no longer be associated 
	// with the UltraTabbedMdiManager.
	//

	// The tab will no longer be associated with the form if it was 
	// closed.
	if (e.Tab.Form == null)
		return;

	// If the TabCloseAction resolves to None, then no action is
	// taken on the tab or associated form so you can perform
	// some custom action.
	if (e.Tab.SettingsResolved.TabCloseAction == MdiTabCloseAction.None)
	{
		// Perform custom action when a close occurs...
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also