When a user types something into a Textbox, it is not just displayed on the screen, it is also assigned to the Text property of the Textbox. This is illustrated in our first Greeting program.
Whatever the user types into the input Textbox (txtNameIn) is displayed there and also assigned to its Text property.
The event handler for clicking on the "Greet" button uses two assignment statements:
Private Sub btnGreet_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btnGreet.Click lblGreeting.Text = "Hi " & txtNameIn.Text & "!" txtGreeting.Text = "Hi " & txtNameIn.Text & "!" End SubThe first instruction tells the computer to evaluate the string expression "Hi " & txtNameIn.Text & "!" and assign the result to the Text property of lblGreeting. The second assigns the value of the expression to the Text property of txtGreeting.
Note that the user cannot type in the Textbox that is intended for output (txtGreeting) because I set its ReadOnly property to true.