Version

StoreTab Event

Event that occurs when the SaveAsBinary(Stream) or SaveAsXml(Stream) method is invoked so that each tab's PersistedInfo may be initialized.
Syntax
'Declaration
 
Public Event StoreTab As StoreTabEventHandler
public event StoreTabEventHandler StoreTab
Event Data

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

PropertyDescription
Tab (Inherited from Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs)Returns the associated MdiTab
Remarks

The StoreTab event is invoked for each MdiTab when the SaveAsXml(Stream) or SaveAsBinary(Stream) method is called. The purpose of the event is to provide a place to initialize the PersistedInfo property before serializing the tabs. The PersistedInfo property can be set outside of this event but often the criteria you will need to create the appropriate form during deserialization will change during the life of the application. This event provides a centralized point to initialize the tabs immediately before serialization without having to iterate through the Tabs of all the TabGroups and the HiddenTabs.

Example
The following example demonstrates how to use the StoreTab event to initialize the PersistedInfo of an MdiTab object.

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_StoreTab(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.StoreTabEventArgs) Handles ultraTabbedMdiManager1.StoreTab
    ' The 'StoreTab' event is invoked when the SaveAsXml or 
    ' SaveAsBinary method is invoked. It is a convenient place 
    ' to initialize the 'PersistedInfo' property of the tabs 
    ' immediately prior to serialization and is invoked once for 
    ' each MdiTab in the TabGroups and in the HiddenTabs. This 
    ' will prevent the need to keep updating the PersistedInfo 
    ' at other points when the information needed to deserialize 
    ' the tab changes - e.g. when the file name of the associated 
    ' form changes.

    If TypeOf e.Tab.Form Is EditForm Then
        e.Tab.PersistedInfo = (CType(e.Tab.Form, EditForm)).FileName
    Else
        e.Tab.PersistedInfo = e.Tab.Form.Text
    End If
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void ultraTabbedMdiManager1_StoreTab(object sender, Infragistics.Win.UltraWinTabbedMdi.StoreTabEventArgs e)
{
	// The 'StoreTab' event is invoked when the SaveAsXml or 
	// SaveAsBinary method is invoked. It is a convenient place 
	// to initialize the 'PersistedInfo' property of the tabs 
	// immediately prior to serialization and is invoked once for 
	// each MdiTab in the TabGroups and in the HiddenTabs. This 
	// will prevent the need to keep updating the PersistedInfo 
	// at other points when the information needed to deserialize 
	// the tab changes - e.g. when the file name of the associated 
	// form changes.

	if (e.Tab.Form is EditForm)
		e.Tab.PersistedInfo = ((EditForm)e.Tab.Form).FileName;
	else
		e.Tab.PersistedInfo = e.Tab.Form.Text;
}
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