You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/designers/disable-dpi-awareness.md
+22-28Lines changed: 22 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: Disable DPI-awareness for scaling in forms
3
3
description: Fix scaling issues with Windows Forms Designer on HDPI monitors.
4
-
ms.date: 02/10/2022
4
+
ms.date: 04/10/2022
5
5
author: TerryGLee
6
6
ms.author: tglee
7
7
manager: jmartens
8
8
ms.technology: vs-ide-designers
9
9
ms.topic: how-to
10
10
ms.custon: contperf-fy22q2
11
11
---
12
-
# Disable DPI-awareness to address scaling issues with Windows Forms Designer in Visual Studio
12
+
# Disable DPI-awareness to fix HDPI / scaling issues with Windows Forms Designer in Visual Studio
13
13
14
14
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).
15
15
@@ -19,37 +19,36 @@ You can also:
19
19
+[Automatically scale in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms)
20
20
+ Select the option to [Optimize rendering for screens with different pixel densities (requires restart)](../ide/reference/general-environment-options-dialog-box.md#visual-experience)
21
21
22
-
## Scaling: Windows Forms Designer on HDPI monitors
22
+
## Scaling issues in Windows Forms Designer on HDPI monitors
23
23
24
-
The **Windows Forms Designer** in Visual Studio doesn't have scaling support. This causes display issues when you open some forms in the **Windows Forms Designer**on high dots per inch (HDPI) monitors. For examples, controls can appear to overlap as shown in the following image:
24
+
Since the **Windows Forms Designer** in Visual Studio doesn't have scaling support, display issues can occur when you open some forms on high dots per inch (HDPI) monitors. For example, controls can appear to overlap as shown in the following image:
25
25
26
-

26
+

27
27
28
-
When you open a form in the **Windows Forms Designer** in Visual Studio on an HDPI monitor, Visual Studio displays an informational bar at the top of the designer:
28
+
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.
29
29
30
-
::: moniker range="vs-2017"
30
+
When you open a form in the **Windows Forms Designer** on an HDPI monitor, Visual Studio displays an informational bar.
31
31
32
-

33
-
34
-
The message reads **Scaling on your main display is set to 200% (192 dpi). This might cause rendering problems in the designer window.**
32
+
::: moniker range=">=vs-2019"
35
33
36
-
> [!NOTE]
37
-
> This informational bar was introduced in Visual Studio 2017 version 15.8.
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.":::
38
35
39
36
::: moniker-end
40
37
41
-
::: moniker range=">=vs-2019"
38
+
::: moniker range="vs-2017"
39
+
The message reads **Scaling on your main display is set to 200% (192 dpi). This might cause rendering problems in the designer window.**
40
+
41
+

42
42
43
-
:::image type="content" source="media/scaling-gold-bar-message.png" alt-text="Screenshot of the informational bar in Visual Studio to restart in DPI-unaware mode.":::
43
+
> [!NOTE]
44
+
> This informational bar was introduced in Visual Studio 2017 version 15.8.
44
45
45
46
::: moniker-end
46
47
47
-
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.
48
48
49
49
> [!TIP]
50
50
> 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`.
51
51
52
-
If you do need to work in the **Windows Forms Designer**, the next section helps you [resolve the problem](#resolve-hdpi-display-problems).
53
52
54
53
## Resolve HDPI display problems
55
54
@@ -64,19 +63,19 @@ There are three options to resolve the display problem:
64
63
65
64
### Restart Visual Studio as a DPI-unaware process
66
65
67
-
You can restart Visual Studio as a DPI-unaware processby selecting the option on the yellow informational bar. This is the preferred way of resolving the problem.
66
+
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.
68
67
69
-
When Visual Studio runs as a DPI-unaware process, the designer layout issues are resolved, but fonts may appear blurry. 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**.
68
+
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**.
70
69
71
70
> [!NOTE]
72
71
> - If you had undocked tool windows in Visual Studio when you selected the option to restart as a DPI-unaware process, the position of those tool windows may change.
73
72
> - 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**.
74
73
75
-
It's important to restart Visual Studio as a DPI-aware process when you're finished working in the **Windows Forms Designer**. When it's running as a DPI-unaware process, fonts can look blurry and you may see issues in other designers such as the **XAML 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.
74
+
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.
76
75
77
76
### Add a registry entry
78
77
79
-
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:
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:
80
79
81
80
**Entry**: Depending on whether you're using Visual Studio 2017, 2019, or 2022, use one of these values:
82
81
@@ -90,24 +89,19 @@ You can mark Visual Studio as DPI-unaware by modifying the registry. Open **Regi
90
89
**Type**: REG_SZ <br>
91
90
**Value**: DPIUNAWARE
92
91
93
-
> [!NOTE]
94
-
> Visual Studio remains in DPI-unaware mode until you remove the registry entry.
92
+
Visual Studio remains in DPI-unaware mode until you remove the registry entry.
95
93
96
94
### Set your display scaling setting to 100%
97
95
98
-
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%**.
99
-
100
-
Setting your display scaling to 100% may be undesirable, because it can make the user interface too small to be usable.
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.
101
97
102
98
## Disable notifications
103
99
104
100
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.
105
101
106
102
To disable notifications:
107
103
1. Choose **Tools** > **Options** to open the **Options** dialog.
108
-
2. Choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**.
109
-
110
-

104
+
2. In the **Options** dialog, choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**.
111
105
112
106
If you want to later reenable scaling notifications, set the property to **True**.
0 commit comments