Skip to content

Commit 8080ee8

Browse files
authored
Merge pull request #10555 from TerryGLee/tglee-patch129
remove the Registry Entry section
2 parents 3ce3dc1 + c5dd1c0 commit 8080ee8

File tree

1 file changed

+23
-35
lines changed

1 file changed

+23
-35
lines changed

docs/designers/disable-dpi-awareness.md

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Disable DPI-awareness for scaling in forms
33
description: Fix scaling issues with Windows Forms Designer on HDPI monitors.
4-
ms.date: 10/20/2022
4+
ms.date: 10/31/2022
55
author: TerryGLee
66
ms.author: tglee
77
manager: jmartens
@@ -13,9 +13,9 @@ ms.custon: contperf-fy22q2
1313

1414
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
1515

16-
In this article, you'll learn the limitations of Windows Forms Designer on HDPI monitors and [how to run Visual Studio as a DPI-unaware process](#resolve-hdpi-display-problems).
16+
In this article, you'll learn about the limitations of Windows Forms Designer on HDPI monitors and [how to run Visual Studio as a DPI-unaware process](#resolve-hdpi-display-problems).
1717

18-
Visual Studio is a dots per inch (DPI) aware application, which means the display scales automatically. If an application states that it's not DPI-aware, the operating system scales the application as a bitmap. This behavior is also called DPI virtualization. The application still thinks that it's running at 100% scaling, or 96 dpi.
18+
Visual Studio is a dots per inch (DPI) aware application, which means the display scales automatically. If an application states that it's not DPI-aware, the operating system scales the application as a bitmap. This behavior is also called DPI virtualization. The application still thinks that it's running at 100% scaling, or 96 DPI.
1919

2020
You can also:
2121
+ [Automatically scale in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms)
@@ -27,81 +27,69 @@ Since the **Windows Forms Designer** in Visual Studio doesn't have scaling suppo
2727

2828
![Windows Forms Designer on HDPI monitor](./media/win-forms-designer-hdpi-1.gif)
2929

30-
If you aren't working in the designer and don't need to adjust the layout of your form, you can ignore the informational bar and continue working in the code editor or in other types of designers. (You can also [disable notifications](#disable-notifications) so that the informational bar doesn't continue to appear.) Only the **Windows Forms Designer** is affected.
30+
### Use the information bar
3131

32-
When you open a form in the **Windows Forms Designer** on an HDPI monitor, Visual Studio displays an informational bar.
33-
34-
:::image type="content" source="media/scaling-gold-bar-message-1.png" alt-text="Screenshot of the informational bar in Visual Studio to restart in DPI-unaware mode.":::
32+
When you open a form in the **Windows Forms Designer** on an HDPI monitor, Visual Studio displays an information bar.
3533

34+
:::image type="content" source="media/scaling-gold-bar-message-1.png" alt-text="Screenshot of the information bar in Visual Studio to restart in DPI-unaware mode.":::
3635

36+
If you aren't working in the designer and don't need to adjust the layout of your form, you can ignore the information bar and continue working in the code editor or in other types of designers. (You can also [disable notifications](#disable-notifications) so that the information bar doesn't continue to appear.) Only the **Windows Forms Designer** is affected.
3737

3838
> [!TIP]
39-
> If you've closed the informational bar at the top of the designer, but you still want to replicate the behavior of the link that says **Restart Visual Studio with 100% scaling**, you still can. Select **Tools** > **Command Line** > **Developer Command Prompt** from the Visual Studio menu bar. Then, enter `devenv /noScale`.
39+
> If you've closed the information bar but you still want restart Visual Studio with 100% scaling, you can. [Use the DevEnv.exe tool](#use-the-devenvexe-tool) to do so.
4040
4141
## Resolve HDPI display problems
4242

43-
There are three options to resolve the display problem:
43+
There are several options to resolve the display problem:
4444

4545
- [Restart Visual Studio as a DPI-unaware process](#restart-visual-studio-as-a-dpi-unaware-process)
46-
- [Add a registry entry](#add-a-registry-entry)
46+
<!-- - [Add a registry entry](#add-a-registry-entry) -->
4747
- [Set your display scaling setting to 100%](#set-your-display-scaling-setting-to-100)
48-
49-
> [!TIP]
50-
> If you prefer to manage settings from the command line, [`devenv.exe`](../ide/reference/devenv-command-line-switches.md) takes `/noscale` as a command-line parameter to run in 100% scaling mode.
48+
- [Use the DevEnv.exe tool](#use-the-devenvexe-tool)
5149

5250
### Restart Visual Studio as a DPI-unaware process
5351

54-
The preferred solution to this issue is to restart Visual Studio as a DPI-unaware process. Do so by selecting the option on the yellow informational bar.
52+
The preferred solution to this issue is to restart Visual Studio as a DPI-unaware process. Do so by selecting the option on the yellow information bar.
5553

56-
When Visual Studio runs as a DPI-unaware process, the designer layout issues are resolved, but fonts may appear blurry and you may see issues in other designers such as the **XAML Designer**.. Visual Studio displays a different yellow informational message when it runs as a DPI-unaware process that says **Visual Studio is running as a DPI-unaware process. WPF and XAML designers might not display correctly.** The informational bar also provides an option to **Restart Visual Studio as a DPI-aware process**.
54+
When Visual Studio runs as a DPI-unaware process, the designer layout issues are resolved, but fonts may appear blurry and you may see issues in other designers such as the **XAML Designer**. Visual Studio displays a different yellow informational message when it runs as a DPI-unaware process that says **Visual Studio is running as a DPI-unaware process. WPF and XAML designers might not display correctly.** The informational bar also provides an option to **Restart Visual Studio as a DPI-aware process**.
5755

5856
::: moniker range="<=vs-2019"
5957

6058
> [!NOTE]
61-
> - If you have undocked tool windows in Visual Studio when you select the option to restart as a DPI-unaware process, the position of the tool windows might change.
59+
> - If you have undocked [tool windows](../ide/customizing-window-layouts-in-visual-studio.md#tool-and-document-windows) in Visual Studio when you select the option to restart as a DPI-unaware process, the position of the tool windows might change.
6260
> - If you use the default Visual Basic profile, or if you have the **Save new projects when created** option deselected in **Tools** > **Options** > **Projects and Solutions**, Visual Studio cannot reopen your project when it restarts as a DPI-unaware process. However, you can open the project by selecting it under **File** > **Recent Projects and Solutions**.
6361
6462
::: moniker-end
6563

6664
::: moniker range=">=vs-2022"
6765

6866
> [!NOTE]
69-
> - If you have undocked tool windows in Visual Studio when you select the option to restart as a DPI-unaware process, the position of the tool windows might change.
67+
> - If you have undocked [tool windows](../ide/customizing-window-layouts-in-visual-studio.md#tool-and-document-windows) in Visual Studio when you select the option to restart as a DPI-unaware process, the position of the tool windows might change.
7068
> - If you use the default Visual Basic profile, Visual Studio cannot reopen your project when it restarts as a DPI-unaware process. However, you can open the project by selecting it under **File** > **Recent Projects and Solutions**.
7169
7270
::: moniker-end
7371

7472
It's important to restart Visual Studio as a DPI-aware process when you're finished working in the **Windows Forms Designer**. If you close and reopen Visual Studio when it's running in DPI-unaware mode, it becomes DPI-aware again. You can also select the **Restart Visual Studio as a DPI-aware process** option in the informational bar.
7573

76-
### Add a registry entry
77-
78-
As option two, you can mark Visual Studio as DPI-unaware by modifying the registry. Open **Registry Editor** and add an entry to the **HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers** subkey:
79-
80-
**Entry**: Depending on whether you're using Visual Studio 2017, 2019, or 2022, use one of these values:
81-
82-
- C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
83-
- C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
84-
- C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe
85-
86-
> [!NOTE]
87-
> If you're using the Professional or Enterprise edition of Visual Studio, replace **Community** with **Professional** or **Enterprise** in the entry. Also replace the drive letter as necessary.
74+
### Set your display scaling setting to 100%
8875

89-
**Type**: REG_SZ <br>
90-
**Value**: DPIUNAWARE
76+
A third option to resolving the issue is to set your display scaling setting to 100% in Windows 10, type **display settings** in the task bar search box, and then select **Change display settings**. In the **Settings** window, set **Change the size of text, apps, and other items** to **100%**. However, setting your display scaling to 100% may be undesirable since it can make the user interface too small to be usable.
9177

92-
Visual Studio remains in DPI-unaware mode until you remove the registry entry.
78+
### Use the DevEnv.exe tool
9379

94-
### Set your display scaling setting to 100%
80+
If you prefer to manage settings from the command line, [`devenv.exe`](../ide/reference/devenv-command-line-switches.md) takes `/noscale` as a command-line parameter to run in 100% scaling mode. Here's how:
9581

96-
A third option to resolving the issue is to set your display scaling setting to 100% in Windows 10, type **display settings** in the task bar search box, and then select **Change display settings**. In the **Settings** window, set **Change the size of text, apps, and other items** to **100%**. However, setting your display scaling to 100% may be undesirable since it can make the user interface too small to be usable.
82+
1. Select **Tools** > **Command Line** > **Developer Command Prompt** from the Visual Studio menu bar.
83+
1. Then, enter `devenv /noScale`.
9784

9885
## Disable notifications
9986

10087
You can choose not to be notified of DPI scaling issues in Visual Studio. You might want to disable notifications if you aren't working in the designer, for example.
10188

10289
To disable notifications:
90+
10391
1. Choose **Tools** > **Options** to open the **Options** dialog.
104-
2. In the **Options** dialog, choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**.
92+
1. In the **Options** dialog, choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**.
10593

10694
If you want to later reenable scaling notifications, set the property to **True**.
10795

0 commit comments

Comments
 (0)