Thursday, December 15, 2011

Name Display

1. Create a project (Name Display) with two Label controls a TextBox, and a Command Button.

2. Modify the Name property of each of the controls as shown.



3. Change the Text property of the Label to “Enter your name here” and set its AutoSize property to True.

4. Double-click the btnClick button to key in the following:



Public Class frmNameDisplay

Private Sub btnClick_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
lblMessage.Text = "Hi " & txtName.Text & " Have a nice day!"
End Sub

End Class


5. Run the program.

No comments:

Post a Comment