Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDock Imports System.IO Private Sub btnLoadXmlLayout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadXmlLayout.Click Dim stream As FileStream = Nothing Dim fileName As String = Application.CommonAppDataPath & "\dockManager.xml" If Not File.Exists(fileName) Then Exit Sub Try stream = New FileStream(fileName, FileMode.Open, FileAccess.Read) Me.ultraDockManager1.LoadFromXML(stream) Finally If Not stream Is Nothing Then stream.Close() End Try End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDock; using System.Diagnostics; using System.IO; private void btnLoadXmlLayout_Click(object sender, System.EventArgs e) { FileStream stream = null; string fileName = Application.CommonAppDataPath + @"\dockManager.xml"; if (!File.Exists(fileName)) return; try { stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); this.ultraDockManager1.LoadFromXML(stream); } finally { if (stream != null) stream.Close(); } }