Version

LoadTabOrderFromXml Method

Loads the tab order from a an XML stream.
Syntax
'Declaration
 
Public Sub LoadTabOrderFromXml( _
   ByVal stream As Stream _
) 
public void LoadTabOrderFromXml( 
   Stream stream
)

Parameters

stream
Stream containing the serialized tab order information.
Example
The following sample code illustrates how to save, load and restore the visible tab order. This is useful when the AllowTabMoving property is true which allows the user to drag tabs around. These methods can then be used to persist the customized tab order between sessions.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabControl
Imports System.IO

Private Sub SaveTabOrder()

    ' Open a stream on a file
    Dim fs As New FileStream("TabOrder.xml", FileMode.OpenOrCreate, FileAccess.Write)

    ' Note: If a stream is kept open in memory betwen calls
    ' to load and save make sure the position is reset before
    ' calling the load or save methods
    'fs.Position = 0

    ' Save the tab order as xml
    Me.ultraTabControl1.SaveTabOrderAsXml(fs)

    ' Note: to save the stream as binary (which is a 
    ' little more efficient) call SaveTabOrderAsBinary
    'Me.ultraTabControl1.SaveTabOrderAsBinary( fs )

    ' close the stream
    fs.Close()

End Sub

Private Sub LoadTabOrder()

    ' Chjeck to see if the file exists before proceeding
    If File.Exists("TabOrder.xml") = False Then
        Exit Sub
    End If

    ' Open a stream on the file
    Dim fs As New FileStream("TabOrder.xml", FileMode.Open, FileAccess.Read)

    ' Note: If a stream is kept open in memory betwen calls
    ' to load and save make sure the position is reset before
    ' calling the load or save methods
    'fs.Position = 0

    ' Load the tab order from the xml stream
    Me.ultraTabControl1.LoadTabOrderFromXml(fs)

    ' Note: to load the stream as binary (which is a 
    ' little more efficient) call LoadTabOrderFromBinary
    'Me.ultraTabControl1.LoadTabOrderFromBinary( fs )

    ' close the stream
    fs.Close()

End Sub

Private Sub RestoreTabOrder()

    ' Calling RestoreTabOrder will re-order the tabs
    ' based on their positions in the Tabs collection.
    ' Each tab's 'VisibleIndex' property values will match
    ' its 'Index' value.
    Me.ultraTabControl1.RestoreTabOrder()

End Sub
using System.Diagnostics;
using System.IO;
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabControl;

private void SaveTabOrder()
{
	// Open a stream on a file
	FileStream fs = new FileStream("TabOrder.xml", FileMode.OpenOrCreate, FileAccess.Write);

	// Note: If a stream is kept open in memory betwen calls
	// to load and save make sure the position is reset before
	// calling the load or save methods
	//fs.Position = 0;

	// Save the tab order as xml
	this.ultraTabControl1.SaveTabOrderAsXml( fs );

	// Note: to save the stream as binary (which is a 
	// little more efficient) call SaveTabOrderAsBinary
	//this.ultraTabControl1.SaveTabOrderAsBinary( fs );

	// close the stream
	fs.Close();
}

private void LoadTabOrder()
{
	// Chjeck to see if the file exists before proceeding
	if ( !File.Exists("TabOrder.xml") )
		return;

	// Open a stream on the file
	FileStream fs = new FileStream("TabOrder.xml", FileMode.Open, FileAccess.Read);

	// Note: If a stream is kept open in memory betwen calls
	// to load and save make sure the position is reset before
	// calling the load or save methods
	//fs.Position = 0;

	// Load the tab order from the xml stream
	this.ultraTabControl1.LoadTabOrderFromXml( fs );

	// Note: to load the stream as binary (which is a 
	// little more efficient) call LoadTabOrderFromBinary
	//this.ultraTabControl1.LoadTabOrderFromBinary( fs );

	// close the stream
	fs.Close();
}
		
private void RestoreTabOrder()
{
	// Calling RestoreTabOrder will re-order the tabs
	// based on their positions in the Tabs collection.
	// Each tab's 'VisibleIndex' property values will match
	// its 'Index' value.
	this.ultraTabControl1.RestoreTabOrder();
}
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