Your First Application in Visual Basic 2008 EE
Click on Start button on the taskbar or
the Window logo in Vista
Click on All Programs
Click on Visual Basic 2008 Express Edition logo.
On the Start page of the application, click on Create
Let's add a text box:
a text box is a text area that allows the user to enter text.
In the Tool Box on the left, click on TextBox
Draw a shape on the form to draw the TextBox.
After placing the TextBox on the form, you can move
anywhere on the Form.
Now insert a label.
Find the Label control from the Tool Box and place it on
Name the Label1 "Name". To do that right click on
Label1, click on Properties
The Properties window will appear on the right.
Change the property of Text to Name:
Name is " &
After adding this code go to Build, Publish
WindowsApplication1. (If you named this application something else, it's
going to appear instead of WindowsApplication1.
Now enter a name inside the first textbox, and
a last name inside the second textbox, and then click on "Get Name" and
you should get something like this:
Did you see how easy we built this application. You
entered the controls easily, part of the code was generated by itself,
and you added a very small piece of code.
wonder how and where did we get the code from. Well let's analyze how we came
out with that code.
Since that the program generates part of
the code for us, let's not worry now how the software does that. Let's look at
the code we wrote:
Name is " &
MsgBox: We told the program
to display a message box that tells us whatever we entered in the form.
Write after MsgBox
notice that we added ( .
Whatever we enter between the two parenthesis is going to show on the message
box. There are two kinds to show the text: directly and indirectly. If a text is
entered between 2 quotations mark like:
"My Name is " is shown exactly as is. Now we wanted to show what inside
the text area that the user enters on the form. We added
& TextBox1.Text , that means we
wanted to show the text in the first text box that is named Textbox1 by default.
If you want to change the form color, or icon or even more go
back to lessons page and learn more about each