Summary


A Visual Studio solution contains a hierarchical arrangement of items. At the top level, it contains one or more projects. Each project contains several standard items such as My Project (that represents the project as a whole), References (that records information about references to external objects), the bin and obj items (that are used by Visual Studio when building the application), and app.config (which holds configuration information). Projects also contain form, class, and other code modules.

Normally, many of these files are hidden and you do not need to edit them directly. Instead, you can double-click Solution Explorer’s My Project entry and use the project’s Properties pages to view and modify application values. Other hidden files store code and resources that determine a form’s appearance, and you can modify them by altering the form with the Form Designer.

Within a code module, you can use modules, classes, regions, and namespaces to group related code into blocks. You can use conditional compilation statements and conditional compilation constants to easily add or remove code to or from the compiled application. The Debug and Trace objects let you generate messages and alerts, depending on whether certain predefined constants are defined.

Finally, typographic elements such as comments, line continuation, and line joining let you format the code so that it is easier to read and understand. XML comments provide additional information that is useful to the Object Browser and that you can use to automatically generate more complete documentation.

Although all of these components are not required by Visual Basic, they can make the difference between understanding the code quickly and completely, and not understanding it at all. Over an application’s lifetime of development, debugging, upgrading, and maintenance, this can determine a project’s success.

This chapter describes structural elements that make up code files. Within those elements, you can place the code that gathers, manipulates, stores, and displays data. Chapter 4 describes the variables that a program uses to hold data values. It explains how to declare variables, what types of data they can hold, and how Visual Basic converts from one data type to another.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net