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 (that 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. For example, if you double-click Solution Explorer’s My Project entry, you can 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 determine which code is compiled into the executable program. 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 IntelliSense and can help you automatically generate more readable documentation.

None of these components are required by Visual Basic but 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 or failure.

This chapter described structural elements that make up code files. Within those elements, you can place the code that gathers, manipulates, stores, and displays data. Chapter 14, “Data Types, Variables, and Constants,” 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.57.172