Public Class Form1 Dim numLines As Integer = 0 'In declarations section 'numLines tells the number of lnies displayed. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If numLines = 0 Then lstoutput.Items.Add("I came to Casablanca for the waters.") numLines += 1 ElseIf numLines = 2 Then lstoutput.Items.Add("I was misinformed.") numLines += 1 End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If numLines = 1 Then lstoutput.Items.Add("But We're in the middle of the desert.") numLines += 1 End If End Sub End Class _ Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. _ Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.lstoutput = New System.Windows.Forms.ListBox Me.SuspendLayout() ' 'Button1 ' Me.Button1.BackColor = System.Drawing.Color.FromArgb(CType(CType(31, Byte), Integer), CType(CType(200, Byte), Integer), CType(CType(224, Byte), Integer)) Me.Button1.Font = New System.Drawing.Font("Monotype Corsiva", 24.0!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.ForeColor = System.Drawing.Color.White Me.Button1.Location = New System.Drawing.Point(57, 94) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(157, 64) Me.Button1.TabIndex = 0 Me.Button1.Text = "Bogart" Me.Button1.UseVisualStyleBackColor = False ' 'Button2 ' Me.Button2.BackColor = System.Drawing.Color.White Me.Button2.Font = New System.Drawing.Font("Monotype Corsiva", 21.75!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(31, Byte), Integer), CType(CType(200, Byte), Integer), CType(CType(224, Byte), Integer)) Me.Button2.Location = New System.Drawing.Point(289, 95) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(157, 63) Me.Button2.TabIndex = 1 Me.Button2.Text = "Raines" Me.Button2.UseVisualStyleBackColor = False ' 'lstoutput ' Me.lstoutput.FormattingEnabled = True Me.lstoutput.Location = New System.Drawing.Point(122, 174) Me.lstoutput.Name = "lstoutput" Me.lstoutput.Size = New System.Drawing.Size(235, 121) Me.lstoutput.TabIndex = 2 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(521, 337) Me.Controls.Add(Me.lstoutput) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents lstoutput As System.Windows.Forms.ListBox End Class