The LoadFromXml method is used in conjunction with the SaveAsXml(Stream) method to persist the property settings and layout of the UltraTabbedMdiManager. All property settings (except the ImageList) are deserialized including the MdiTab objects and TabGroups. After the information has been deserialized, the RestoreTab event is invoked for each serialized MdiTab so that the appropriate Form may be associated with the tab. If the tab is not associated with a Form in this event, the tab will be discarded.
Imports Infragistics.Win Imports Infragistics.Win.UltraWinTabs Imports Infragistics.Win.UltraWinTabbedMdi Private Sub SaveXmlLayout() Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath) Dim fileName As String = path + "\\TabbedMdiLayout.dat" Dim fs As System.IO.FileStream = New System.IO.FileStream(fileName, System.IO.FileMode.OpenOrCreate) Try fs.Seek(0, System.IO.SeekOrigin.Begin) Me.ultraTabbedMdiManager1.SaveAsXml(fs) Finally fs.Close() End Try End Sub Private Sub LoadXmlLayout() Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath) Dim fileName As String = path + "\\TabbedMdiLayout.dat" Dim fs As System.IO.FileStream = Nothing If Not System.IO.File.Exists(fileName) Then Return End If Try fs = New System.IO.FileStream(fileName, System.IO.FileMode.Open) fs.Seek(0, System.IO.SeekOrigin.Begin) Me.ultraTabbedMdiManager1.LoadFromXml(fs) Finally If Not fs Is Nothing Then fs.Close() End If End Try End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinTabs; using Infragistics.Win.UltraWinTabbedMdi; private void SaveXmlLayout() { string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath); string fileName = path + "\\TabbedMdiLayout.dat"; System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.OpenOrCreate); try { fs.Seek(0, System.IO.SeekOrigin.Begin); this.ultraTabbedMdiManager1.SaveAsXml(fs); } finally { fs.Close(); } } private void LoadXmlLayout() { string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath); string fileName = path + "\\TabbedMdiLayout.dat"; System.IO.FileStream fs = null; if (!System.IO.File.Exists(fileName)) return; try { fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open); fs.Seek(0, System.IO.SeekOrigin.Begin); this.ultraTabbedMdiManager1.LoadFromXml(fs); } finally { if (fs != null) fs.Close(); } }
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