' Project Greeter2 ' Input the name of a person in a textbox. ' Output a greeting to that person in another textbox ' when the show button is clicked. Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. 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) 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. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtName As System.Windows.Forms.TextBox Friend WithEvents txtGreeting As System.Windows.Forms.TextBox Friend WithEvents btnShow As System.Windows.Forms.Button Private Sub InitializeComponent() Me.txtName = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.txtGreeting = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.btnShow = New System.Windows.Forms.Button Me.SuspendLayout() ' 'txtName ' Me.txtName.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtName.Location = New System.Drawing.Point(32, 24) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(232, 29) Me.txtName.TabIndex = 0 Me.txtName.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(112, 64) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(64, 24) Me.Label1.TabIndex = 1 Me.Label1.Text = "Name" ' 'txtGreeting ' Me.txtGreeting.Location = New System.Drawing.Point(32, 160) Me.txtGreeting.Multiline = True Me.txtGreeting.Name = "txtGreeting" Me.txtGreeting.Size = New System.Drawing.Size(232, 64) Me.txtGreeting.TabIndex = 2 Me.txtGreeting.Text = "" ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(96, 232) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(88, 32) Me.Label2.TabIndex = 3 Me.Label2.Text = "Greeting" ' 'btnShow ' Me.btnShow.Location = New System.Drawing.Point(32, 104) Me.btnShow.Name = "btnShow" Me.btnShow.Size = New System.Drawing.Size(232, 40) Me.btnShow.TabIndex = 4 Me.btnShow.Text = "Show Greeting" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(10, 22) Me.ClientSize = New System.Drawing.Size(292, 278) Me.Controls.Add(Me.btnShow) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtGreeting) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.txtName) Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "Form1" Me.Text = "Greeter2 Project" Me.ResumeLayout(False) End Sub #End Region ' Event handler for Click event of the btnShow button. Private Sub btnShow_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnShow.Click txtGreeting.Text = "Hello, " & txtName.Text & ControlChars.NewLine & _ "How are you?" End Sub End Class