_ 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.txtoutput = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'Button1 ' Me.Button1.BackColor = System.Drawing.Color.FromArgb(CType(CType(7, Byte), Integer), CType(CType(1, Byte), Integer), CType(CType(3, Byte), Integer)) Me.Button1.Font = New System.Drawing.Font("Arial Black", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.ForeColor = System.Drawing.Color.White Me.Button1.Location = New System.Drawing.Point(168, 80) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(157, 60) Me.Button1.TabIndex = 0 Me.Button1.Text = "Calculate Tip" Me.Button1.UseVisualStyleBackColor = False ' 'txtoutput ' Me.txtoutput.Location = New System.Drawing.Point(168, 207) Me.txtoutput.Name = "txtoutput" Me.txtoutput.Size = New System.Drawing.Size(157, 20) Me.txtoutput.TabIndex = 2 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(226, Byte), Integer), CType(CType(22, Byte), Integer), CType(CType(79, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(505, 336) Me.Controls.Add(Me.txtoutput) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents txtoutput As System.Windows.Forms.TextBox End Class Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Give Server a tip. Dim cost, tip As Double cost = CDbl(InputBox("Enter cost of meal:")) tip = cost * 0.15 If tip < 1 Then tip = 1 End If txtoutput.Text = "Leave " & FormatCurrency(tip) & " for the tip." End Sub End Class