Step 1: Create a Windows Forms Application Project
The first step in creating a picture viewer is to create a Windows Forms application project.
For a video version of this topic, see Tutorial 1: Create a Picture Viewer in Visual Basic - Video 1 or Tutorial 1: Create a Picture Viewer in C# - Video 1.
To create a Windows Forms application project
On the File menu, click New Project.
If you’re not using Visual Studio Express, you need to select a language first. From the Installed Templates list, select either C# or Visual Basic.
Click the Windows Forms Application icon, enter PictureViewer as the name, and then click OK. Visual Studio automatically creates the solution for you.
On the File menu, click Save All, or on the toolbar, click the Save All button, which appears as follows.
Visual Studio saves the project in your projects folder. The integrated development environment (IDE) automatically fills in the folder name and project name. If you’re using Visual Studio Express, you need to complete steps 5-7. For non-Express versions of Visual Studio, a project is saved when it's first created, so steps 5-7 aren't necessary.
Make sure the project is saved in a folder under your My Documents folder.
Verify that the Create Directory for Solution check box is selected.
When you create your project, the Visual Studio IDE automatically creates several files for you and puts them in a folder. You can explore those files using the Solution Explorer window. When you first create your project, the files are saved in a temporary folder. Clicking the Save All button tells the IDE to copy them to a permanent folder (which is typically under your My Documents folder).
You may have noticed that the words solution and project have different meanings, which will be explained later in this tutorial.
The following picture shows what your IDE window should look like.
If your screen doesn't look like the preceding picture, on the Window menu, click Reset Window Layout. If any of the windows are missing, on the View menu, click Properties Window or Solution Explorer. If there's an extra window open, click the Close (x) button in the upper right.
Look at the picture. From the upper left and going clockwise, the picture shows:
Main window This is where you do most of your work. You use this window to work with forms and edit code. Currently, it shows a form in the Form Editor. At the top of the window, there are two tabs: the Start Page tab and the Form1.cs [Design] tab. (In Visual Basic, it's .vb instead of .cs.)
Solution Explorer window This is where all the files in your solution appear. If you click a file, the information inside the Properties window changes. If you double-click a code file (which ends in .cs in Visual C# and .vb in Visual Basic), the code file or a designer for the code file opens.
Properties window This is where you change the properties of items that you select in the other windows.
Notice how the top line in the Solution Explorer window shows Solution 'PictureViewer' (1 project). The IDE created a solution for you, and a solution can contain more than one project. For now, you will work with solutions that contain a single project.