Skip to content

Commit a595fb6

Browse files
authored
Shortening a tad (internal) (#9789)
* Shortening a tad (internal) * Update disable-dpi-awareness.md * Update disable-dpi-awareness.md * Delete win-forms-designer-hdpi.png replacing with smaller * Delete scaling-gold-bar-message.png replacing with smaller * Add files via upload * Update disable-dpi-awareness.md
1 parent 1fd8b98 commit a595fb6

File tree

5 files changed

+22
-28
lines changed

5 files changed

+22
-28
lines changed

docs/designers/disable-dpi-awareness.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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: 02/10/2022
4+
ms.date: 04/10/2022
55
author: TerryGLee
66
ms.author: tglee
77
manager: jmartens
88
ms.technology: vs-ide-designers
99
ms.topic: how-to
1010
ms.custon: contperf-fy22q2
1111
---
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
1313

1414
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).
1515

@@ -19,37 +19,36 @@ You can also:
1919
+ [Automatically scale in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms)
2020
+ Select the option to [Optimize rendering for screens with different pixel densities (requires restart)](../ide/reference/general-environment-options-dialog-box.md#visual-experience)
2121

22-
## Scaling: Windows Forms Designer on HDPI monitors
22+
## Scaling issues in Windows Forms Designer on HDPI monitors
2323

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:
2525

26-
![Windows Forms Designer on HDPI monitor](./media/win-forms-designer-hdpi.png)
26+
![Windows Forms Designer on HDPI monitor](./media/win-forms-designer-hdpi-1.gif)
2727

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.
2929

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.
3131

32-
![Screenshot of the informational bar in Visual Studio 2017 to restart in DPI-unaware mode.](./media/scaling-gold-bar.png)
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"
3533

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.":::
3835

3936
::: moniker-end
4037

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+
![Screenshot of the informational bar in Visual Studio 2017 to restart in DPI-unaware mode.](./media/scaling-gold-bar.png)
4242

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.
4445
4546
::: moniker-end
4647

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.
4848

4949
> [!TIP]
5050
> 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`.
5151
52-
If you do need to work in the **Windows Forms Designer**, the next section helps you [resolve the problem](#resolve-hdpi-display-problems).
5352

5453
## Resolve HDPI display problems
5554

@@ -64,19 +63,19 @@ There are three options to resolve the display problem:
6463
6564
### Restart Visual Studio as a DPI-unaware process
6665

67-
You can restart Visual Studio as a DPI-unaware process by 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.
6867

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**.
7069

7170
> [!NOTE]
7271
> - 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.
7372
> - 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**.
7473
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.
7675

7776
### Add a registry entry
7877

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:
8079

8180
**Entry**: Depending on whether you're using Visual Studio 2017, 2019, or 2022, use one of these values:
8281

@@ -90,24 +89,19 @@ You can mark Visual Studio as DPI-unaware by modifying the registry. Open **Regi
9089
**Type**: REG_SZ <br>
9190
**Value**: DPIUNAWARE
9291

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.
9593

9694
### Set your display scaling setting to 100%
9795

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.
10197

10298
## Disable notifications
10399

104100
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.
105101

106102
To disable notifications:
107103
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-
![DPI scaling notifications option in Visual Studio](./media/notifications-option.png)
104+
2. In the **Options** dialog, choose **Windows Forms Designer** > **General**, and set **DPI Scaling Notifications** to **False**.
111105

112106
If you want to later reenable scaling notifications, set the property to **True**.
113107

Loading
-23.8 KB
Binary file not shown.
Loading
-22.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)