18.01.2013 Views

Mastering Visual Basic .NET

Mastering Visual Basic .NET

Mastering Visual Basic .NET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

74<br />

Chapter 2 VISUAL BASIC PROJECTS<br />

Registry Editor Button<br />

Click this button to add new keys to the user’s Registry. You don’t have to add anything to the user’s<br />

Registry, especially for this project. But you can place special strings in the Registry, like an encoded<br />

date to find out when a demo version of your application may expire. You must first familiarize<br />

yourself with the Registry and how to program it with <strong>Visual</strong> <strong>Basic</strong>, before you attempt to use it<br />

with your applications.<br />

File Types Editor Button<br />

If your application uses its own file type, you can associate that type with your application, so that<br />

when the user double-clicks a file of this type your application starts automatically. This is a sure way<br />

to ruin the user’s file associations. If your application can handle GIF images or HTML files, don’t<br />

even think of taking over these files. Use this option only with files that are unique to your application.<br />

To add a new file type on the user’s machine, click the File Types Editor button on the Properties<br />

window. On the Designer’s surface, you will see a single item: File Types On Target Machine.<br />

Right-click the item and select Add File Type. This command will add a new file type and the verb<br />

&Open under it. Click the new file type and you will see its properties in the Properties window.<br />

You can assign a description to the new file type, its extension, and the command that will be used<br />

to open the files of this type (the name of your application’s EXE file).<br />

User Interface Editor Button<br />

Click this button and you will see the steps of the installation on the Designer’s surface, as shown in<br />

Figure 2.20. Each phase of the installation process has one or more steps, and a different dialog box<br />

is displayed at each step. Some of the dialog boxes contain messages, like a short description of the<br />

application or a copyright message. These strings are exposed as properties of the corresponding dialog<br />

box, and you can change them. Just click a dialog box in the User Interface Editor and then look<br />

up its properties in the Properties window.<br />

Figure 2.20<br />

The outline of the<br />

installation process<br />

The wizard inserts all the necessary dialog boxes, but you can add custom dialog boxes. If you do,<br />

you must also provide some code to process the user’s selections on the custom dialog box. For our<br />

simple example, we don’t need any customized dialog boxes. I will repeat here that the topic of creating<br />

a customized Windows installer is one of the major aspects of <strong>Visual</strong> Studio.<strong>NET</strong>, and when

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!