Starting a Demo Project
When you learned the basics of Visual Basic, you were always starting a new project, but the concept of managing the project was usually never covered. A Visual Basic project by definition is a collection of files used to build an application. As you work on your application, you'll be working with many different files. Your project will include one or more of the following files:
Solution file (.SLN)
Project file (.VBProj)
Common VB files (.VB, .ResX, .XSD, .SDL)
Data files (.XSD, .XML)
Web files (.AS**, .HTM**)
NOTE
All of the files that you were used to working with.FRM, .CLS, .FRX, and .BASare all suffixed with .VB in the new version of Visual Basic.NET.
To maintain your project files, you'll use the Solution Explorer window, which always displays a current list of the files in the solution. The Solution Explorer window in Figure 1.7 shows some of the different files that you might have included in your project.
Figure 1.7 Every file in your solution or application is listed in the Solution Explorer window.
Whenever you add, remove, or modify any files in your application, you need to save your project. Each time you save the project, Visual Basic updates the project file. The project file contains the same list of files shown in the Project Explorer window, as well as references to any other objects being used by the project. Figure 1.8 shows an example of a project file's contents.
Figure 1.8 A project file in Notepad showing the different information saved for the project.
The Project
When Visual Basic.NET is started, you are presented with the Visual Studio development environment (see Figure 1.9). From here you can start a new project, open an existing project, or select a project that you have recently used.
Figure 1.9 When Visual Basic.NET is started, you are presented with a Start Page.
However, if you don't want this page displayed at startup, you can modify it by selecting My Profile from the list and modifying the settings for the development environment as shown in Figure 1.10.
Figure 1.10 Modifying the development settings.
At this point, start Visual Basic.NET, and then start a new Windows Application Project. A new solution and project will be created that contains one form. Before you continue, change the name of the solution to TYVB Demo, the project to FileCopy, the form to frmMain, and then save them.
To customize your application project itself, set one or more properties associated with the project. To access the Project Properties dialog box, choose Project, Properties from the menu (see Figure 1.11). Any changes you make to these properties are also saved to the project file.
Figure 1.11 The project Properties dialog box allows you to customize your applications information and configuration options.
The project has two main topics that you can modify: Common and Configuration properties. For the moment the two important property sheets are the General and Build sheets. The General properties (see Figure 1.12) allow you to specify the startup object and what type of output you want created when the project is compiled. It also allows you to rename the application namespace and program name.
Figure 1.12 The General property sheet provides the standard startup and naming properties for an application.
The Build property sheet (see Figure 1.13) lets you set the icon for the application and which of the three compiler options you want set for the application.
Figure 1.13 Setting the compiler options and application icon.
The Configuration topic provides you with the capability to set some of the debug options (see Figure 1.14) as well as the optimization properties, which will be covered on Day 19, "Performance and Tuning."
Figure 1.14 Setting configuration properties for the application.
Environment Properties
Finally, you can also modify any settings that control your working environment. To access these options, select Tools, Options from the main menu. This will display the Options dialog with the Environment folder open, as shown in Figure 1.15. As you can see, you can modify almost anything that relates to how the environment interacts with you and your application.
Figure 1.15 Modifying the options for the development environment.