Datasheet

Your First Program
You’re actually well on the way to creating your first program in Visual Basic 2005 Express. Earlier in the
chapter, you created a Windows Application that generated a blank form. On the form, you added a but-
ton. To finish the job, you’ll need to write a single line of code that will be executed when a user clicks on
the button. The following Try It Out walks you through the entire process of creating the project, adding
the button to the form, and writing your first line of code.
Try It Out Creating Your First Program
If you didn’t create the project in the previous part of this chapter, follow these steps:
1. Start Visual Basic 2005 Express. As mentioned previously, you’ll find the link to Visual Basic in
your main All Programs list on the Start menu.
2. Create a new Visual Basic project by selecting File New Project. This will present you with the
New Project window, listing all available project templates (see Figure 1-5).
Figure 1-5
By default, Windows Application should be selected. This will create a normal program that
runs in Windows. Click OK when you’re ready to have the project generated for you.
3. After a moment, you will be presented with a blank form in the center of the IDE. Find the
Button control in the Toolbox and double-click it to automatically add it to the form in the top-
left corner.
4. Select the Button object that was added to the form by clicking it once. Locate the Text prop-
erty in the Properties window (it may be easier if you sort it alphabetically) and change it to
Say
Hello
. To do this, you should click the right-hand column next to Text to access the value (by
default it says
Button1, which is the name of the control).
11
Basic Installation
05_595733 ch01.qxd 12/1/05 1:34 PM Page 11