Imports System.IO
...
Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As System.Object, _
ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) _
Handles UltraToolbarsManager1.ToolClick
If e.Tool.Key = "Load" Then
' Creates the file stream
Dim fs As FileStream = Nothing
Try
' Finds the specified file
fs = New FileStream("TabbedMDILayout.dat", FileMode.Open)
fs.Seek(0, IO.SeekOrigin.Begin)
' Loads the layout from the file
Me.UltraTabbedMdiManager1.LoadFromBinary(fs)
Catch ex As FileNotFoundException
MessageBox.Show(ex.Message.ToString())
Finally
' Closes the file stream
fs.Close()
End Try
ElseIf e.Tool.Key = "Save" Then
' Creates the file stream
Dim fs As New FileStream("TabbedMDILayout.dat", FileMode.OpenOrCreate)
fs.Seek(0, SeekOrigin.Begin)
' Saves the layout to the file stream
Me.UltraTabbedMdiManager1.SaveAsBinary(fs)
' Closes the file stream
fs.Close()
End If
End Sub