Public Class TransactionForm Inherits System.Windows.Forms.Form Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() End Sub Public Overridable Function Save(ByVal FileName As String) As Boolean 'declare a file and serialize class Dim TranFile As Stream Dim BinSerialize As BinaryFormatter 'Set the return value to True Save = True 'Use Try/Catch to handle any errors Try 'Allocate and create a new file and serialize objects TranFile = File.Open(FileName, FileMode.Create) BinSerialize = New BinaryFormatter() 'Serialize the form data BinSerialize.Serialize(TranFile, AmountField.ToString()) BinSerialize.Serialize(TranFile, MemoField.ToString()) BinSerialize.Serialize(TranFile, DateField.ToString()) Catch 'Indicate an error occurred Save = False End Try TranFile.Close() End Function ... End Class