Document ToggleSwitch CheckAlign behavior for CheckBox and RadioButton - #14880
Merged
KlausLoeffelmann merged 2 commits intoAug 14, 2026
Conversation
LeafShi1
requested review from
KlausLoeffelmann,
SimonZhao888 and
ricardobossan
and
a lite review from Copilot
August 12, 2026 09:32
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates WinForms API documentation to clarify how CheckAlign behaves when CheckBox/RadioButton render as toggle switches under .NET 11-or-later visual styles mode, addressing the confusion reported in #14810.
Changes:
- Added XML
<remarks>toCheckBox.CheckAlignandRadioButton.CheckAligndocumenting that center alignments behave like left alignments, and right alignments behave like right alignments when rendered as a toggle switch. - Added XML
<remarks>toRadioButton.Appearancedescribing toggle-switch rendering behavior and linking to the .NET 11 VisualStyles layout guidance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/RadioButton.cs | Adds XML remarks for Appearance and CheckAlign describing toggle-switch behavior in .NET 11-or-later modes. |
| src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/CheckBox.cs | Adds XML remarks for CheckAlign describing toggle-switch alignment handling in .NET 11-or-later modes. |
Suppressed comments (3)
src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/RadioButton.cs:80
- To avoid ambiguity with the RadioButton.Appearance property and follow existing XML-doc convention, qualify the enum in cref as Forms.Appearance.ToggleSwitch (see CheckBox.Appearance.Docs.cs:15 and ButtonBase.FlatStyle.Docs.cs:22).
/// <see cref="Appearance.ToggleSwitch"/> selects the framework's owner-drawn toggle renderer in an
src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/RadioButton.cs:139
- For consistency with other docs and to disambiguate from the Appearance property, qualify the enum cref as Forms.Appearance.ToggleSwitch (see CheckBox.Appearance.Docs.cs:15).
/// When <see cref="Appearance"/> is <see cref="Appearance.ToggleSwitch"/> and the control renders as a toggle
/// switch in an effective .NET 11-or-later mode,
src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/RadioButton.cs:135
- The summary refers to the "check box portion" of a RadioButton. This appears to be a copy/paste error and should refer to the radio button portion instead.
/// <summary>
/// Gets or sets the location of the check box portion of the radio button control.
/// </summary>
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14810
Proposed changes
CheckBox.CheckAlignandRadioButton.CheckAlign.CheckAlignvalues are handled when the control renders as a toggle switch in .NET 11-or-later visual styles mode:Customer Impact
CheckAlignvalues do not center the toggle switch when usingAppearance.ToggleSwitch. This clarifies the intended behavior and reduces confusion.Regression?
Risk
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow