10.1. Creating Templates

There are two types of templates: those that create new project items and those that create entire projects. Both types of templates essentially have the same structure, as you will see later, except that they are placed in different template folders. The project templates appear in the New Project dialog, whereas the item templates appear in the Add New Item dialog.

10.1.1. Item Template

Although it is possible to build a template manually, it is much quicker to create one from an existing sample and make changes as required. This section begins by looking at an item template—in this case, an About form that contains some basic information, such as the application's version number and who wrote it.

To begin, create a new Visual Basic Windows Forms application called StarterProject. Instead of creating an About form from scratch, you can customize the About Box template that ships with Visual Studio. Right-click the StarterProject project, select Add New Item, and add a new About Box. Customize the default About screen by deleting the logo and first column of the TableLayoutPanel. The customized About screen is shown in Figure 10-1.

Figure 10.1. Figure 10-1

To make a template out of the About form, select the Export Template item from the File menu. This ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.