Skip to content

Commit 3fa6967

Browse files
authored
Add docs for HighDpiMode (#2996)
* initial commit * some edits * Apply suggestions from tech review Co-Authored-By: Igor Velikorossov <[email protected]> * add remarks for PerMonitor value * feedback * feedback * feedback for related API
1 parent 4806dbb commit 3fa6967

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

xml/System.Windows.Forms/Application.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
14931493
In [!INCLUDE[csprcslong](~/includes/csprcslong-md.md)] or later, a call to <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> is automatically generated in the Program.cs file. To change the text rendering default, modify the generated code.
14941494
1495-
```scr
1495+
```csharp
14961496
static class Program
14971497
{
14981498
/// <summary>
@@ -1543,7 +1543,17 @@ static class Program
15431543
<summary>Sets the high DPI mode of the process.</summary>
15441544
<returns>
15451545
<see langword="true" /> if the high DPI mode was set; otherwise, <see langword="false" />.</returns>
1546-
<remarks>To be added.</remarks>
1546+
<remarks>
1547+
<format type="text/markdown"><![CDATA[
1548+
1549+
## Remarks
1550+
1551+
If an application carries an application manifest file and the DPI mode was set in that file, this method will fail to set or change the mode that was already set by the application manifest.
1552+
The high DPI mode is set once per process. For more information about setting the DPI mode via the application manifest file, see [Setting the default DPI awareness for a process](https://docs.microsoft.com/previous-versions/windows/desktop/legacy/mt846517(v%3Dvs.85)).
1553+
1554+
1555+
]]></format>
1556+
</remarks>
15471557
</Docs>
15481558
</Member>
15491559
<Member MemberName="SetSuspendState">

xml/System.Windows.Forms/HighDpiMode.xml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,22 @@
1313
<BaseTypeName>System.Enum</BaseTypeName>
1414
</Base>
1515
<Docs>
16-
<summary>To be added.</summary>
17-
<remarks>To be added.</remarks>
16+
<summary>Specifies the different high DPI modes that can be applied to an application.</summary>
17+
<remarks>
18+
<format type="text/markdown"><![CDATA[
19+
20+
## Remarks
21+
22+
Specifying the high DPI mode is dependent on the OS version of the machine you're running your application on. Setting the high DPI mode will work on machines running Windows 10 Creators Update (version 1703) or later versions.
23+
24+
Changing the DPI mode after the application has started running doesn't impact scaling (that is, the change won't take effect).
25+
26+
If you're using the `PerMonitor` value and there is more than one monitor attached with different DPI settings, the DPI may change when the window is moved from one monitor to the other.
27+
In this case, the application rescales according to the new monitor's DPI settings.
28+
Alternatively, the DPI of a window can be changed when the OS scaling setting is changed for the monitor the window is on.
29+
30+
]]></format>
31+
</remarks>
1832
</Docs>
1933
<Members>
2034
<Member MemberName="DpiUnaware">
@@ -34,7 +48,7 @@
3448
</ReturnValue>
3549
<MemberValue>0</MemberValue>
3650
<Docs>
37-
<summary>To be added.</summary>
51+
<summary>The application window does not scale for DPI changes and always assumes a scale factor of 100%.</summary>
3852
</Docs>
3953
</Member>
4054
<Member MemberName="DpiUnawareGdiScaled">
@@ -54,7 +68,7 @@
5468
</ReturnValue>
5569
<MemberValue>4</MemberValue>
5670
<Docs>
57-
<summary>To be added.</summary>
71+
<summary>Similar to <see cref="F:System.Windows.Forms.HighDpiMode.DpiUnaware" />, but improves the quality of GDI/GDI+ based content.</summary>
5872
</Docs>
5973
</Member>
6074
<Member MemberName="PerMonitor">
@@ -74,7 +88,7 @@
7488
</ReturnValue>
7589
<MemberValue>2</MemberValue>
7690
<Docs>
77-
<summary>To be added.</summary>
91+
<summary>The window checks for DPI when it's created and adjusts scale factor when the DPI changes.</summary>
7892
</Docs>
7993
</Member>
8094
<Member MemberName="PerMonitorV2">
@@ -94,7 +108,7 @@
94108
</ReturnValue>
95109
<MemberValue>3</MemberValue>
96110
<Docs>
97-
<summary>To be added.</summary>
111+
<summary>Similar to <see cref="F:System.Windows.Forms.HighDpiMode.PerMonitor" />, but enables child window DPI change notification, improved scaling of comctl32 controls, and dialog scaling.</summary>
98112
</Docs>
99113
</Member>
100114
<Member MemberName="SystemAware">
@@ -114,7 +128,7 @@
114128
</ReturnValue>
115129
<MemberValue>1</MemberValue>
116130
<Docs>
117-
<summary>To be added.</summary>
131+
<summary>The window queries for the DPI of the primary monitor once and uses this for the application on all monitors.</summary>
118132
</Docs>
119133
</Member>
120134
</Members>

0 commit comments

Comments
 (0)