Imports System.Diagnostics Imports System.IO Imports System.Runtime.Serialization Imports System.Runtime.Serialization.Formatters.Binary Imports System.Runtime.Serialization.Formatters.Soap Imports Infragistics.Win Imports Infragistics.Win.UltraWinToolbars Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click Try Dim Stream As New FileStream("C:\\Layout.xml", FileMode.Open) If Not Stream Is Nothing Then Stream.Seek(0, SeekOrigin.Begin) Me.UltraToolbarsManager1.LoadFromXml(Stream) Stream.Close() End If Catch Debug.WriteLine("Error encountered while loading stream!") End Try End Sub
using System.Diagnostics; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Soap; using Infragistics.Win; using Infragistics.Win.UltraWinToolbars; private void button12_Click(object sender, System.EventArgs e) { try { FileStream stream = new FileStream("C:\\Layout.xml", FileMode.Open); if (stream != null) { stream.Seek(0, SeekOrigin.Begin); this.ultraToolbarsManager1.LoadFromXml(stream); stream.Close(); } } catch { Debug.WriteLine("Error encountered while loading stream!"); } }