We recommend using Visual Studio 2017

Step 1: Create a Windows Forms Application Project

When you create a picture viewer, the first step is to create a Windows Forms Application project.

link to videoFor 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

  1. On the File menu, choose New Project.

  2. If you’re not using an Express version of Visual Studio, choose either Visual C# or Visual Basic in the Installed Templates list.

  3. Choose the Windows Forms Application icon, name the form PictureViewer, and then choose the OK button.

    Visual Studio creates the solution.

  4. On the File menu, choose Save All.

    As an alternative, choose the Save All button on the toolbar, which the following illustration shows.

    Save All toolbar button

    Save All toolbar button

    Visual Studio automatically fills in the folder name and the project name and then saves the project in your projects folder.

    Note Note

    If you’re not using an Express version of Visual Studio, you can skip the next step.

  5. Make sure that the project is saved in a folder under your My Documents folder, verify that the Create Directory for Solution check box is selected, and then choose the Save button.

    Note Note

    When you create your project, Visual Studio creates several files for you and puts them in a temporary folder, and you can explore them in Solution Explorer. When you choose the Save All button, Visual Studio copies them to a permanent folder that's typically under your My Documents folder.

    You may have noticed that the words solution and project have different meanings. These words will be explained later in this tutorial.

    The following illustration shows the Visual Studio interface.

    IDE window

    IDE window
  6. The interface contains three windows : a main window, Solution Explorer, and the Properties window.

    Note Note

    Your window layout may not look exactly like this illustration. The precise window layout depends on the version of Visual Studio and other factors. However, you should verify that all three windows appear.

    If any of these windows are missing, restore the default window layout by, on the menu bar, choosing Window, Reset Window Layout. You can also display windows by using menu commands. On the menu bar, choose View, Properties Window or Solution Explorer. If any other windows are open, close them by choosing the Close (x) button in their upper-right corners.

  7. The illustration shows the following windows (going clockwise from the upper-left corner):

    • Main window   In this window, you'll do most of your work, such as working with forms and editing code. In the illustration, the window shows a form in the Form Editor. At the top of the window, the Start Page tab and the Form1.cs [Design] tab appear. (In Visual Basic, the tab name ends with .vb instead of .cs.)

    • Solution Explorer window In this window, you can view and navigate to all items in your solution. If you choose a file, the contents of the Properties window changes. If you open 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 appears. A designer is a visual surface onto which you can add controls such as buttons and lists.

    • Properties window In this window, you can change the properties of items that you choose in the other windows. For example, if you choose Form1, you can change its title by setting the Text property, and you can change the background color by setting the Backcolor property.

    Note Note

    The top line in Solution Explorer shows Solution 'PictureViewer' (1 project), which means that Visual Studio created a solution for you. A solution can contain more than one project, but for now, you'll work with solutions that contain only one project.

To continue or review