Public MustInherit 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 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()) 'Call SaveData() to save derived class's data SaveData(BinSerialize, TranFile) Catch 'Indicate an error occurred Save = False End Try TranFile.Close() End Function 'Declare Abstract method to save derived class's data Protected MustOverride Sub SaveData(ByRef BinSerialize _ As BinaryFormatter, ByRef TranFile As Stream) ... End Class