Skip to content

Commit f69b3f0

Browse files
lonitracarlossanlopgewarren
authored
Port WinForms docs for 9.0 (#10247)
* Port WinForms API Docs for 9.0 Co-authored-by: Carlos Sánchez López <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent a97aeb7 commit f69b3f0

16 files changed

+448
-165
lines changed

xml/System.Windows.Forms.Design.Behavior/BehaviorServiceAdornerCollection.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Docs>
4545
<summary>Stores <see cref="T:System.Windows.Forms.Design.Behavior.Adorner" /> objects in a strongly typed collection.</summary>
4646
<remarks>To be added.</remarks>
47+
<seealso cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" />
4748
</Docs>
4849
<Members>
4950
<MemberGroup MemberName=".ctor">
@@ -193,6 +194,7 @@
193194
<returns>The index at which the new element was inserted.</returns>
194195
<remarks>To be added.</remarks>
195196
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.AddRange(System.Windows.Forms.Design.Behavior.Adorner[])" />
197+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.AddRange(System.Windows.Forms.Design.Behavior.Adorner[])" />
196198
</Docs>
197199
</Member>
198200
<MemberGroup MemberName="AddRange">
@@ -247,6 +249,7 @@
247249
<summary>Copies the elements of an array to the end of the <see cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" />.</summary>
248250
<remarks>To be added.</remarks>
249251
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
252+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
250253
</Docs>
251254
</Member>
252255
<Member MemberName="AddRange">
@@ -282,6 +285,7 @@
282285
<summary>Adds the contents of another <see cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" /> to the end of the collection.</summary>
283286
<remarks>To be added.</remarks>
284287
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
288+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
285289
</Docs>
286290
</Member>
287291
<Member MemberName="Contains">
@@ -319,6 +323,7 @@
319323
<see langword="true" /> if the <see cref="T:System.Windows.Forms.Design.Behavior.Adorner" /> is contained in the collection; otherwise, <see langword="false" />.</returns>
320324
<remarks>To be added.</remarks>
321325
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.IndexOf(System.Windows.Forms.Design.Behavior.Adorner)" />
326+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.IndexOf(System.Windows.Forms.Design.Behavior.Adorner)" />
322327
</Docs>
323328
</Member>
324329
<Member MemberName="CopyTo">
@@ -366,6 +371,7 @@ The number of elements in the <see cref="T:System.Windows.Forms.Design.Behavior.
366371
<exception cref="T:System.ArgumentOutOfRangeException">
367372
<paramref name="arrayIndex" /> is less than the lower bound of <paramref name="array" />.</exception>
368373
<altmember cref="T:System.Array" />
374+
<seealso cref="T:System.Array" />
369375
</Docs>
370376
</Member>
371377
<Member MemberName="GetEnumerator">
@@ -399,6 +405,7 @@ The number of elements in the <see cref="T:System.Windows.Forms.Design.Behavior.
399405
<returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" /> instance.</returns>
400406
<remarks>To be added.</remarks>
401407
<altmember cref="T:System.Collections.IEnumerator" />
408+
<seealso cref="T:System.Collections.IEnumerator" />
402409
</Docs>
403410
</Member>
404411
<Member MemberName="IndexOf">
@@ -435,6 +442,7 @@ The number of elements in the <see cref="T:System.Windows.Forms.Design.Behavior.
435442
<returns>The index of the <see cref="T:System.Windows.Forms.Design.Behavior.Adorner" /> of <paramref name="value" /> in the <see cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" />, if found; otherwise, -1.</returns>
436443
<remarks>To be added.</remarks>
437444
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Contains(System.Windows.Forms.Design.Behavior.Adorner)" />
445+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Contains(System.Windows.Forms.Design.Behavior.Adorner)" />
438446
</Docs>
439447
</Member>
440448
<Member MemberName="Insert">
@@ -472,6 +480,7 @@ The number of elements in the <see cref="T:System.Windows.Forms.Design.Behavior.
472480
<summary>Inserts an <see cref="T:System.Windows.Forms.Design.Behavior.Adorner" /> into the <see cref="T:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection" /> at the specified index.</summary>
473481
<remarks>To be added.</remarks>
474482
<altmember cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
483+
<seealso cref="M:System.Windows.Forms.Design.Behavior.BehaviorServiceAdornerCollection.Add(System.Windows.Forms.Design.Behavior.Adorner)" />
475484
</Docs>
476485
</Member>
477486
<Member MemberName="Item">

xml/System.Windows.Forms/AccessibleEvents.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@
587587
<MemberValue>9</MemberValue>
588588
<Docs>
589589
<summary>A window has lost mouse capture. The system sends the event; servers never send this event.</summary>
590+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemCaptureStart" />
590591
</Docs>
591592
</Member>
592593
<Member MemberName="SystemCaptureStart">
@@ -614,6 +615,7 @@
614615
<MemberValue>8</MemberValue>
615616
<Docs>
616617
<summary>A window is being moved or resized. The system sends the event; servers never send this event.</summary>
618+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemCaptureEnd" />
617619
</Docs>
618620
</Member>
619621
<Member MemberName="SystemContextHelpEnd">
@@ -641,6 +643,7 @@
641643
<MemberValue>13</MemberValue>
642644
<Docs>
643645
<summary>A window exited context-sensitive Help mode. The system does not send the event consistently.</summary>
646+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemContextHelpStart" />
644647
</Docs>
645648
</Member>
646649
<Member MemberName="SystemContextHelpStart">
@@ -668,6 +671,7 @@
668671
<MemberValue>12</MemberValue>
669672
<Docs>
670673
<summary>A window entered context-sensitive Help mode. The system does not send the event consistently.</summary>
674+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemContextHelpEnd" />
671675
</Docs>
672676
</Member>
673677
<Member MemberName="SystemDialogEnd">
@@ -695,6 +699,7 @@
695699
<MemberValue>17</MemberValue>
696700
<Docs>
697701
<summary>A dialog box was closed. The system does not send the event for standard dialog boxes. Servers send this event for custom dialog boxes. The system does not send the event consistently.</summary>
702+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemDialogStart" />
698703
</Docs>
699704
</Member>
700705
<Member MemberName="SystemDialogStart">
@@ -722,6 +727,7 @@
722727
<MemberValue>16</MemberValue>
723728
<Docs>
724729
<summary>A dialog box was displayed. The system sends the event for standard dialog boxes. Servers send this event for custom dialog boxes. The system does not send the event consistently.</summary>
730+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemDialogEnd" />
725731
</Docs>
726732
</Member>
727733
<Member MemberName="SystemDragDropEnd">
@@ -749,6 +755,7 @@
749755
<MemberValue>15</MemberValue>
750756
<Docs>
751757
<summary>An application is about to exit drag-and-drop mode. Applications that support drag-and-drop operations must send this event; the system does not.</summary>
758+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemDragDropStart" />
752759
</Docs>
753760
</Member>
754761
<Member MemberName="SystemDragDropStart">
@@ -776,6 +783,7 @@
776783
<MemberValue>14</MemberValue>
777784
<Docs>
778785
<summary>An application is about to enter drag-and-drop mode. Applications that support drag-and-drop operations must send this event; the system does not.</summary>
786+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemDragDropEnd" />
779787
</Docs>
780788
</Member>
781789
<Member MemberName="SystemForeground">
@@ -830,6 +838,7 @@
830838
<MemberValue>5</MemberValue>
831839
<Docs>
832840
<summary>A menu from the menu bar was closed. The system sends this event for standard menus. Servers send this event for custom menus.</summary>
841+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMenuStart" />
833842
</Docs>
834843
</Member>
835844
<Member MemberName="SystemMenuPopupEnd">
@@ -860,6 +869,7 @@
860869
<para>A shortcut menu was closed. The system sends this event for standard menus. Servers send this event for custom menus. When a shortcut menu is closed, the client receives this message followed almost immediately by the <see langword="SystemMenuEnd" /> event. The system does not send the event consistently.</para>
861870
<para>For a call to <c>TrackPopupMenu()</c>, a client will see <see langword="EVENT_SYSTEM_MENUSTART" /> followed almost immediately by <see langword="EVENT_SYSTEM_MENUPOPUPSTART" /> for the popup being shown.</para>
862871
</summary>
872+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMenuPopupStart" />
863873
</Docs>
864874
</Member>
865875
<Member MemberName="SystemMenuPopupStart">
@@ -890,6 +900,7 @@
890900
<para>A shortcut menu was displayed. The system sends this event for standard menus. Servers send this event for custom menus. The system does not send the event consistently.</para>
891901
<para>For a call to <c>TrackPopupMenu()</c>, a client will see <see langword="EVENT_SYSTEM_MENUSTART" /> followed almost immediately by <see langword="EVENT_SYSTEM_MENUPOPUPSTART" /> for the popup being shown.</para>
892902
</summary>
903+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMenuPopupEnd" />
893904
</Docs>
894905
</Member>
895906
<Member MemberName="SystemMenuStart">
@@ -917,6 +928,7 @@
917928
<MemberValue>4</MemberValue>
918929
<Docs>
919930
<summary>A menu item on the menu bar was selected. The system sends this event for standard menus. Servers send this event for custom menus. The system might raise more than one <see langword="MenuStart" /> event that might or might not have a corresponding <see langword="MenuEnd" /> event.</summary>
931+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMenuEnd" />
920932
</Docs>
921933
</Member>
922934
<Member MemberName="SystemMinimizeEnd">
@@ -944,6 +956,7 @@
944956
<MemberValue>23</MemberValue>
945957
<Docs>
946958
<summary>A window object was minimized or maximized. The system sends the event; servers never send this event.</summary>
959+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMinimizeStart" />
947960
</Docs>
948961
</Member>
949962
<Member MemberName="SystemMinimizeStart">
@@ -971,6 +984,7 @@
971984
<MemberValue>22</MemberValue>
972985
<Docs>
973986
<summary>A window object is about to be minimized or maximized. The system sends the event; servers never send this event.</summary>
987+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMinimizeEnd" />
974988
</Docs>
975989
</Member>
976990
<Member MemberName="SystemMoveSizeEnd">
@@ -998,6 +1012,7 @@
9981012
<MemberValue>11</MemberValue>
9991013
<Docs>
10001014
<summary>The movement or resizing of a window is finished. The system sends the event; servers never send this event.</summary>
1015+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMoveSizeStart" />
10011016
</Docs>
10021017
</Member>
10031018
<Member MemberName="SystemMoveSizeStart">
@@ -1025,6 +1040,7 @@
10251040
<MemberValue>10</MemberValue>
10261041
<Docs>
10271042
<summary>A window is being moved or resized. The system sends the event; servers never send this event.</summary>
1043+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemMoveSizeEnd" />
10281044
</Docs>
10291045
</Member>
10301046
<Member MemberName="SystemScrollingEnd">
@@ -1052,6 +1068,7 @@
10521068
<MemberValue>19</MemberValue>
10531069
<Docs>
10541070
<summary>Scrolling has ended on a scroll bar. The system sends this event for scroll bars attached to a window and for standard scroll bar controls. Servers send this event for custom scroll bars.</summary>
1071+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemScrollingStart" />
10551072
</Docs>
10561073
</Member>
10571074
<Member MemberName="SystemScrollingStart">
@@ -1079,6 +1096,7 @@
10791096
<MemberValue>18</MemberValue>
10801097
<Docs>
10811098
<summary>Scrolling has started on a scroll bar. The system sends the event for scroll bars attached to a window and for standard scroll bar controls. Servers send this event for custom scroll bars.</summary>
1099+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemScrollingEnd" />
10821100
</Docs>
10831101
</Member>
10841102
<Member MemberName="SystemSound">
@@ -1133,6 +1151,7 @@
11331151
<MemberValue>21</MemberValue>
11341152
<Docs>
11351153
<summary>The user released ALT+TAB. The system sends the <see langword="SwitchEnd" /> event; servers never send this event. If only one application is running when the user presses ALT+TAB, the system sends the <see langword="SwitchEnd" /> event without a corresponding <see langword="SwitchStart" /> event.</summary>
1154+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemSwitchStart" />
11361155
</Docs>
11371156
</Member>
11381157
<Member MemberName="SystemSwitchStart">
@@ -1160,6 +1179,7 @@
11601179
<MemberValue>20</MemberValue>
11611180
<Docs>
11621181
<summary>The user pressed ALT+TAB, which activates the switch window. If only one application is running when the user presses ALT+TAB, the system raises the <see langword="SwitchEnd" /> event without a corresponding <see langword="SwitchStart" /> event.</summary>
1182+
<seealso cref="F:System.Windows.Forms.AccessibleEvents.SystemSwitchEnd" />
11631183
</Docs>
11641184
</Member>
11651185
<Member MemberName="ValueChange">

xml/System.Windows.Forms/Application.xml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@
252252
<ReturnType>System.Windows.Forms.SystemColorMode</ReturnType>
253253
</ReturnValue>
254254
<Docs>
255-
<summary>To be added.</summary>
255+
<summary>Gets the default color mode (dark mode) for the application.</summary>
256256
<value>To be added.</value>
257-
<remarks>To be added.</remarks>
257+
<remarks>This is the <see cref="P:System.Windows.Forms.Application.SystemColorMode" />; which either has been set by <see cref="M:System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode)" /> or its default value <see cref="F:System.Windows.Forms.SystemColorMode.Classic" />.
258+
If it has been set to <see cref="F:System.Windows.Forms.SystemColorMode.System" />, then the actual color mode is determined by the system settings (which can be retrieved by the static (shared in VB) <see cref="P:System.Windows.Forms.Application.SystemColorMode" /> property.</remarks>
258259
</Docs>
259260
</Member>
260261
<Member MemberName="CommonAppDataPath">
@@ -982,9 +983,9 @@
982983
<ReturnType>System.Boolean</ReturnType>
983984
</ReturnValue>
984985
<Docs>
985-
<summary>To be added.</summary>
986+
<summary>Gets a value indicating whether the application is running in a dark system color context.</summary>
986987
<value>To be added.</value>
987-
<remarks>To be added.</remarks>
988+
<remarks>In a high contrast mode, this will always return <see langword="false" />.</remarks>
988989
</Docs>
989990
</Member>
990991
<Member MemberName="LeaveThreadModal">
@@ -1811,9 +1812,25 @@
18111812
<Parameter Name="systemColorMode" Type="System.Windows.Forms.SystemColorMode" Index="0" FrameworkAlternate="windowsdesktop-9.0" />
18121813
</Parameters>
18131814
<Docs>
1814-
<param name="systemColorMode">To be added.</param>
1815-
<summary>To be added.</summary>
1816-
<remarks>To be added.</remarks>
1815+
<param name="systemColorMode">The application's default color mode (dark mode) to set.</param>
1816+
<summary>Sets the default color mode (dark mode) for the application.</summary>
1817+
<remarks>
1818+
<para>
1819+
You should use this method to set the default color mode (dark mode) for the application. Set it before creating any UI elements to ensure that the correct color mode
1820+
is used. You can set it to dark mode (<see cref="F:System.Windows.Forms.SystemColorMode.Dark" />), light mode (<see cref="F:System.Windows.Forms.SystemColorMode.Classic" />)
1821+
or to the system setting (<see cref="F:System.Windows.Forms.SystemColorMode.System" />).
1822+
</para>
1823+
<para>
1824+
If you set it to <see cref="F:System.Windows.Forms.SystemColorMode.System" />, the actual color mode is determined by the Windows system settings. If the system setting is changed,
1825+
the application will not automatically adapt to the new setting.
1826+
</para>
1827+
<para>
1828+
Note that the dark color mode is only available from Windows 11 on or later versions. If the system is set to a high contrast mode, the dark mode is not available.
1829+
</para>
1830+
<para>
1831+
<b>Note for Visual Basic:</b> If you are using the Visual Basic Application Framework, you should set the color mode by handling the Application Events (see <see cref="E:Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.ApplyApplicationDefaults" />).
1832+
</para>
1833+
</remarks>
18171834
</Docs>
18181835
</Member>
18191836
<Member MemberName="SetCompatibleTextRenderingDefault">
@@ -1930,6 +1947,7 @@ You can adjust text scale with the **Make text bigger** slider on the **Settings
19301947
<exception cref="T:System.ArgumentNullException">
19311948
<paramref name="font" /> is <see langword="null" />.</exception>
19321949
<exception cref="T:System.InvalidOperationException">You can only call this method before the first window is created by your Windows Forms application.</exception>
1950+
<seealso href="https://docs.microsoft.com/windows/uwp/design/input/text-scaling" />
19331951
</Docs>
19341952
</Member>
19351953
<Member MemberName="SetHighDpiMode">
@@ -2225,9 +2243,15 @@ The high DPI mode is set once per process. For more information about setting th
22252243
<ReturnType>System.Windows.Forms.SystemColorMode</ReturnType>
22262244
</ReturnValue>
22272245
<Docs>
2228-
<summary>To be added.</summary>
2246+
<summary>Gets the system color mode setting of the OS system environment.</summary>
22292247
<value>To be added.</value>
2230-
<remarks>To be added.</remarks>
2248+
<remarks>
2249+
<para>
2250+
The color setting is determined based on the operating system version and its system settings. It returns <see cref="F:System.Windows.Forms.SystemColorMode.Dark" /> if the dark mode is enabled in the system settings, <see cref="F:System.Windows.Forms.SystemColorMode.Classic" /> if the color mode equals the light, standard color setting.
2251+
</para>
2252+
<para><c>SystemColorMode</c> is supported on Windows 11 or later versions.</para>
2253+
<para><c>SystemColorModes</c> is not supported if the Windows OS <c>High Contrast Mode</c> has been enabled in the system settings.</para>
2254+
</remarks>
22312255
</Docs>
22322256
</Member>
22332257
<Member MemberName="ThreadException">

xml/System.Windows.Forms/ButtonBase.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ For example, consider a button control whose <xref:System.Windows.Forms.ImageLis
10401040
<exception cref="T:System.ArgumentOutOfRangeException">
10411041
<paramref name="value" /> is less than -1.</exception>
10421042
<altmember cref="T:System.Windows.Forms.ImageList" />
1043+
<inheritdoc cref="P:System.Windows.Forms.ButtonBase.ImageKey" />
10431044
</Docs>
10441045
</Member>
10451046
<Member MemberName="ImageKey">

0 commit comments

Comments
 (0)