Datasheet

Note one little - known feature of this tab: Using the Add Resource drop - down button and selecting an image
(not an existing image but one based on one of the available image types) will create a new image fi le and
automatically open Microsoft Paint (for Express Edition developers); this enables you to actually create the
image that will be in the image fi le.
Users of Visual Studio 2010 have additional capabilities not supported by Visual Basic s Express Edition.
For one thing, instead of using Paint, Visual Studio provides a basic image - editing tool, so when Visual
Studio developers add a new image (not from a fi le), this editor opens within Visual Studio.
Additionally, within the list of Add Resource items, Visual Studio users can select or create a new icon.
Choosing to create a new icon opens Visual Studio s icon editor, which provides a basic set of tools for
creating custom icons to use as part of your application. This makes working with
.ico les easier because
you don t have to hunt for or purchase such fi les online; instead, you can create your own icons.
However, images aren t the only resources that you can embed with your executable. Resources also apply
to the fi xed text strings that your application uses. By default, people tend to embed this text directly into
the source code so that it is easily accessible to the developer. Unfortunately, this leaves the application
diffi cult to localize for use with a second language. The solution is to group all of those text strings together,
thereby creating a resource fi le containing all of the text strings, which is still part of and easily accessible
to the application source code. When the application is converted for use in another language, this list
of strings can be converted, making the process of localization easier. Localization is covered in detail in
Chapter 27.
The next tab is the Services tab. This tab is discussed in more detail in Chapter 13, which
addresses services.
Settings
As noted earlier in the discussion of the Solution Explorer, the default project template does not create any
application settings; accordingly, an app.config le is neither needed nor created. app.config les are
XML fi les that defi ne any custom application settings that a developer wants to be able to change without
needing to recompile the application. Because these settings live in an XML fi le, they can be modi ed in
between or even during application execution.
One original goal of .NET was to reduce the version con ict that can occur when a component has
registered with global settings. A con ict would occur if two different applications were attempting to
reference two different versions of that component. Because the settings were global and stored in the
central system registry, only one could be registered correctly. Since the different applications each wanted
its speci c version of the component and related settings, one of the applications worked while the other
application broke.
.NET provided the capability to place version - specifi c project references in a local directory with the
application, enabling two different applications to reference the appropriate version of that component.
However, the second part of the problem was the central application settings. The
app.config le
provides the same capability, but its goal is to allow for local storage of application settings. Under .NET
1.x, support for application settings was still minimal, as most developers were still looking to the central
system registry for this purpose. At the same time, the developer tools associated with settings were also
minimal.
Fortunately, under .NET 2.0 this changed dramatically. Visual Studio 2010 provides signi cant support
for application settings, including the Settings tab, shown in Figure 1 - 12. This tab enables Visual
Basic developers to identify application settings and automatically create these settings within the
app.config le.
Visual Basic Keywords and Syntax
25
CH001.indd 25CH001.indd 25 4/5/10 11:56:39 AM4/5/10 11:56:39 AM