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 Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click Try Dim Stream As New FileStream("C:\\Layout.bin", FileMode.Open) If Not (Stream Is Nothing) Then Stream.Seek(0, SeekOrigin.Begin) Me.UltraToolbarsManager1.LoadFromBinary(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 button11_Click(object sender, System.EventArgs e) { try { FileStream stream = new FileStream("C:\\Layout.bin", FileMode.Open); if (stream != null) { stream.Seek(0, SeekOrigin.Begin); this.ultraToolbarsManager1.LoadFromBinary(stream); stream.Close(); } } catch { Debug.WriteLine("Error encountered while loading stream!"); } }