You are on page 1of 4

Name:

NDP:

LABSHEET 1
INSTRUCTION: PLEASE COMPLETE ALL THE TASK.
TITLE: CREATE HELLO WORLD PROGRAM

Using textbox and Button

1. Start Visual Studio 2010.

2. On the file menu click New Project. Ensure that the Visual basic Category is
selected on the left side of the dialog box, and the Windows Form Application
template is also selected.

3. Remove the default project name and then type MyHello

4. Click the Textbox control in the toolbox, then draw a Textbox like the following
picture.
5. Click the Button control, then draw it below the text box on the form like the
following picture.

6. Set the following property for the button object by using the Properties
Window:

Control Property Setting

Button 1 (Name) btnOk


Text OK

7. Double-click the OK Button and type the following program statement between
the Private Sub btnOk_Click and End Sub statement in the Code Editor:

Public Class Form1

Private Sub btnOk_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles btnOk.Click

TextBox1.Text = "HELLO WORLD"

End Sub
End Class

8. Click the Start Debugging button on the Standard Toolbar and the program will
display as shown here:

You might also like