How to Design a Windows Forms Application
(Page 1 of 5 )
Building Windows applications is not difficult with the help of Visual Studio. In this article, the first part of a two-part series, you'll learn how to plan the interface for a Windows Forms application. This article is excerpted from chapter two of
Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456).
In the last chapter, you learned the basic skills for working with Visual Studio, you toured a Windows Forms application, and you tested an application with three Windows forms. Now, in this chapter, you’ll learn how to use Visual Studio to design the user interface for a Windows Forms application.
How to set options and create a new project
Before you start your first Windows Forms application with Visual Studio 2008, you probably should change a few of the Visual Studio options. You may also want to change the import and export settings.
How to set the Visual Studio options
To set the options for Visual Studio, you use the Options dialog box shown in figure 2-1. Once this dialog box is open, you can expand the Projects and Solutions group by clicking on the plus sign to the left of that group, and you can click on the General group to display the options shown in this figure.
You can set the default project location by typing a path directly into the text box, or you can click the button to the right of the text box to display a dialog box that lets you navigate to the folder you want to use. This will set the default location for new projects, but you can always override the default when you create a new project.
By default, most of the options are set the way you want. However, if you want Visual Studio to work the way it’s described in this book, you should check the Always Show Solution and the Save New Projects When Created options. Beyond that, it’s worth taking a few minutes to review the other options that are available. Then, you can change them if Visual Studio isn’t working the way you want it to. For instance, you may want to use the Startup group within the Environment group to stop the display of the Start Page.
How to change the import and export settings
The first time you start Visual Studio 2008, you’re asked what Default Environment Settings you want to use. You can choose from five options including Visual Basic, Visual C#, and Web. Among other things, your choice affects what items are available from some menus and what buttons are available from the Standard toolbar. If, for example, you choose the Visual Basic settings, you open a project with the File->Open Project command. But if you choose the Visual C# settings, you open a project with the File->Open-> Project/Solution command.
To change these settings, you use the Import and Export Settings Wizard as described in this figure. In the first step of the wizard, choose the Reset All Settings option. In the second step, choose the Yes, Save My Current Settings option. And in the last step, if you want your menus to work as described in this book, choose the Visual Basic Development Settings option. Later, if you switch to C# or web development, you can change the settings again.
The Options dialog box for setting the project options
How to use the Options dialog box
To display the Options dialog box, select the Tools->Options command. To show all of the option settings, check the Show All Settings box.
To expand and collapse a group of options, you can use the plus (+) and minus (-) signs to the left of each group. To display the options for a group, click on the group.
To set the default location for all projects that you start from Visual Studio, you can change the Visual Studio Projects Location as shown above.
If you want Visual Studio to work the way this book describes it, check the Always Show Solution box and the Save New Projects When Created box.
Although most of the options should be set the way you want them, you may want to familiarize yourself with the options in each category so you know what’s available.
How to set the Import and Export Settings
- The first time you start Visual Studio 2008, you are asked to choose the default environment settings. These settings affect how the menus work and what buttons are displayed on the Standard toolbar.
- To change the settings to the ones used for this book, use the Tools->Import and Export Settings command to start the Settings Wizard. Then, choose the Reset All Settings option, the Save My Current Settings option, and the Visual Basic Development Settings option as you step through the wizard.
Express Edition differences
Figure 2-1. How to set the Visual Studio options
Next: How to create a new project >>
More Visual Basic.NET Articles
More By Murach Publishing
|
This article is excerpted from chapter two of Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456). Check it out today at your favorite bookstore. Buy this book now.
|
|