Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 2 Writing Your First Program 63


Windows Installer is a more classic installation process. In Visual Studio, you add a setup or
a Windows Installer project to your solution, which automatically creates a setup program
for the application. The installer package is distributed to your users, and individual users
run the setup file and work through a wizard to install the application. The setup project
can be customized to allow for different methods of installation, such as from CD-ROMs
or Web servers. You can get started with Windows Installer by using the New Project
command on the File menu to create a custom setup project. (Select the Setup And
Deployment\Visual Studio Installer option under Other Project Types to see the list of
available setup projects .)
Whether you choose ClickOnce or Windows Installer, you’ll find that Visual Studio 2010
has brought many improvements to the installation process, and these technologies will
directly benefit you and your customers. For additional information, see the online Help
documentation related to the installation option that you want to use.

One Step Further: Adding to a Program


You can restart Visual Studio at any time and work on a programming project you’ve stored
on disk. You’ll restart Visual Studio now and add a Randomize statement to the Lucky Seven
program.

Reload Lucky Seven


  1. On the Windows taskbar, click Start, click All Programs, click Microsoft Visual Studio
    2010, and then click the Microsoft Visual Studio 2010 program icon (or the Microsoft
    Visual Basic 2010 Express program icon, if you’re using Visual Basic 2010 Express).
    A list of the projects that you’ve most recently worked on appears on the Visual Studio
    Start Page in the Recent Project pane. Because you just finished working with Lucky
    Seven, the MyLucky7 project should be first on the list.

  2. Click the MyLucky7 link to open the Lucky Seven project.


The Lucky Seven program opens, and the MyLucky7 form appears. (If you don’t see
the form, click Form1 .vb in Solution Explorer, and then click the View Designer button .)
Now you’ll add the Randomize statement to the Form_Load procedure, a special
procedure that is associated with the form and that is executed each time the
program is started.


  1. Double-click the form (not one of the objects) to display the Form_Load procedure.


The Form_Load procedure appears in the Code Editor, as shown here:
Free download pdf