Share via


Exercise 1: Creating a default Ribbon in an application

In this exercise you will start by creating a MFC application with Ribbon in Windows 7 style from scratch in Visual Studio 2010. You do not need to write any code to do that. Just click, click and click!

Task 1 - Create a new MFC project with Ribbon in Visual Studio 2010

  1. In Visual Studio 2010, use the MFC Application Wizard to create an MFC application that has a default ribbon. To run the wizard, on the File menu, point to New, and then select Project. The New Project dialog box will be displayed.
  2. In the New Project dialog box, expand the Visual C++ node in the Project Types pane and select MFC. In the Templates pane, select MFC Application. Type a name for the project, such as RibbonApp, and click OK. Please refer to Figure 1-1. The MF Application Wizard will be displayed.

    Figure 1-1

  3. In the Application Type pane, change Project Style to “Office”, and change Visual Style and Colors to “Windows 7”. Leave everything else as it is, and click Next. Please refer to Figure 1-2.

    Figure 1-2

  4. Leave the Compound Document Support settings at the default (the “None” checkbox is checked). Please refer to Figure 1-3.

    Figure 1-3

  5. In the Document Template Strings pane, leave everything at the default. Please refer to Figure 1-4.

    Figure 1-4

  6. In the Database Support pane, leave everything at the default settings (“None” should be selected). Click Next. Please refer to Figure 1-5.

    Figure 1-5

  7. In the User Interface Features pane, make sure that the Use a Ribbon option is selected. Click Next. Please refer to Figure 1-6.

    Figure 1-6

  8. In the Advanced frame pane, clear all options. Click Next. Please refer to Figure 1-7.

    Figure 1-7

  9. In the Generated Classes pane, leave everything at the default settings. Please refer to Figure 1-8.

    Figure 1-8

  10. To build the application, on the Build menu, select Build Solution. If the application builds successfully, run the application by selecting Start Debugging from the Debug menu. The wizard will automatically create a Ribbon in Windows 7 Style with one Ribbon category that is named Home. This category contains three ribbon panels, which are named Clipboard, View and Window. Please refer to Figure 1-9.

    Figure 1-9