Exercise 2: Run the Application at the 144 DPI Setting

In this exercise, you run the application at the 144 DPI setting, and then compare the UI elements to those at the 96 DPI setting. Initially, the application's form's AutoScaleMode property is configured to None, so no scaling will be done.

Task 1 - Run the Application at the 144 DPI Setting

  1. In Visual Studio 2008, open the HighDPIApp.sln solution.
  2. Set the HighDPIManagedApp to be the startup project.
  3. On the Build menu, click Build Solution.
  4. On the Debug menu, click Start Debugging. The application appears, as shown in the following screen shot:

Task 2 - Compare the UI at the 144 DPI Setting to the 96 DPI Setting

The following screen shot shows how the UI of the application looks when running at the 96 DPI setting.

  1. Now compare this UI to the UI from the 144 DPI setting:

    The following table summarizes the appearances of the application UI at the 144 DPI setting as compared to at the 96 DPI setting.

    UI element

    Appearance at 144 DPI

    Size of the window frame

    Same

    Size of the buttons

    Same

    Size of image box

    Same

    Size of the text

    Larger

    Clipped text on the buttons

    Yes

    Clipped text in the window

    Yes

    Aspect ratio preserved

    Yes

    Note:
    Help

    Notice that the text is clipped, and the sizes of the buttons, image box, and window frame remain small. This is caused by the form's AutoScaleMode property, which is set to None. This setting means no automatic scaling will be done on the form and its controls so they remain in their original size.

    In order to scale the sizes of all UI elements of the application, you must to modify the AutoScaleMode property of the application's form to different values as demonstrated in the following exercise.