Class MsgReader Inherits System.Windows.Forms.Form Private Msg As SmartMsg Private Msg2 As SmartMsg Public Sub New(ByRef Msg As SmartMsg) MyBase.New() MsgReader = Me Me.Msg = Msg Msg2 = New SmartMsg("msg2.bin") 'This call is required by the Win Form Designer. InitializeComponent() 'TODO: Add any initialization after the InitializeComponent() call TextBox.Text = Msg.MsgText() TextBox2.Text = Msg2.MsgText() End Sub Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) 'Dispose messages Msg.Dispose() Msg2.Dispose() End Sub #Region " Windows Form Designer generated code " 'Required by the Windows Form Designer Private components As System.ComponentModel.Container 'Control variables Private WithEvents TextBox As TextBox Private WithEvents TextBox2 As TextBox Private WithEvents btnCancel As Button Private WithEvents btnOK As Button Dim WithEvents MsgReader As System.Windows.Forms.Form Private Sub InitializeComponent() Me.TextBox = New System.Windows.Forms.TextBox() Me.btnOK = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button() Me.TextBox2 = New System.Windows.Forms.TextBox() Me.SuspendLayout() ' 'TextBox ' Me.TextBox.AcceptsReturn = True Me.TextBox.Multiline = True Me.TextBox.Name = "TextBox" Me.TextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox.Size = New System.Drawing.Size(288, 104) Me.TextBox.TabIndex = 0 Me.TextBox.Text = "" ' 'btnOK ' Me.btnOK.Location = New System.Drawing.Point(128, 232) Me.btnOK.Name = "btnOK" Me.btnOK.TabIndex = 1 Me.btnOK.Text = "OK" ' 'btnCancel ' Me.btnCancel.Location = New System.Drawing.Point(208, 232) Me.btnCancel.Name = "btnCancel" Me.btnCancel.TabIndex = 2 Me.btnCancel.Text = "Cancel" ' 'TextBox2 ' Me.TextBox2.AcceptsReturn = True Me.TextBox2.Location = New System.Drawing.Point(0, 112) Me.TextBox2.Multiline = True Me.TextBox2.Name = "TextBox2" Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox2.Size = New System.Drawing.Size(288, 104) Me.TextBox2.TabIndex = 1 Me.TextBox2.Text = "" ' 'MsgReader ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(288, 261) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TextBox, Me.TextBox2, Me.btnOK, Me.btnCancel}) Me.Name = "MsgReader" Me.Text = "Task" Me.ResumeLayout(False) End Sub #End Region Protected Sub btnOK_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles btnOK.Click ' Save the simple message Msg.MsgText = TextBox.Text() Msg2.MsgText = TextBox2.Text() Msg.Write() Close() End Sub Protected Sub btnCancel_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles btnCancel.Click End End Sub End Class