Soup to Nuts Lab 1: A Tour of Visual Studio.Net - Exercise 1: Create a Simple Windows Forms Application (Page 2 of 6 ) Scenario In this exercise, you will start up the Visual Studio IDE, and you will create a simple Windows Form application. You will also add controls to a form. Tasks Detailed Steps Start Visual Studio 2003.
Click Start | All Programs | Microsoft Visual Studio .NET 2003 | Microsoft Visual Studio .NET 2003.
Create a New Windows Forms Application Project
Note: This is a dual-language lab intended for both C# and Visual Basic .NET. You can choose the language in which you want to code to complete the procedures. When you see the word language (for example, Visual <language> Projects), this indicates that the project can be either Visual C# Projects or Visual Basic Projects. Choose the language you are using, and then proceed.
Click File and choose New | Project.
Select Visual <language> Projects in the Project Types list.
Choose Windows Application from the Templates list.
Type Northwind in the Name box.
Click OK.
Visual Studio creates a new solution and a new Windows Forms project based on the template, and adds a Form1 class file, an AssemblyInfo class file, and some references to the project in the C:\Documents and Settings\<user>\My Documents\Visual Studio Projects folder, unless you change the Location: box.
- Add a new form.
- Click View and choose Solution Explorer.
If not already visible, the Solution Explorer pane becomes visible in the right-hand side of the IDE.
- In the Solution Explorer pane, right click Northwind project node, choose Add | Add Windows Form.
The Add New Item dialog box displays.
- Type Customers in the Name box.
- Click Open.
Visual Studio creates a Customers form and adds it to the Northwind project, opening the new form in the forms designer.
- Add some controls to the form.
- Click View and chose Toolbox.
If not already visible, the Toolbox pane becomes visible in the left-hand side of the IDE.
- Drag a Label from the Toolbox and drop it onto the Customers form designer surface.
The forms designer renders a label named Label1 on the Customers form.
- Drag a TextBox from the Toolbox and drop it onto the Customers form designer surface.
The forms designer renders a text box named TextBox1 on the Customers form.
- Drag a Button from the Toolbox and drop it onto the Customers form designer surface.
The forms designer renders a button named Button1 on the Customers form
- Using drag/drop, arrange the controls and size the form to look like the following form:
Note: forms and most controls have “handles” that when the object is selected, you can “grab” with the mouse in order to size them by left-clicking and holding with the mouse and dragging to size.
 | Take Microsoft software for a test drive. With MSDN Virtual Labs, you get full access to all available Microsoft products through 90-minute modules, each with its own downloadable manual. Try this lab out now. |
Next: Exercise 2 Using the Visual Studio .NET IDE Tools >>
More .NET Articles More By MSDN Virtual Labs |