Skip to content

Document ToggleSwitch CheckAlign behavior for CheckBox and RadioButton - #14880

Merged
KlausLoeffelmann merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14810_complete_remarks
Aug 14, 2026
Merged

Document ToggleSwitch CheckAlign behavior for CheckBox and RadioButton#14880
KlausLoeffelmann merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14810_complete_remarks

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Fixes #14810

Proposed changes

  • Added XML remarks for CheckBox.CheckAlign and RadioButton.CheckAlign.
  • Documented how CheckAlign values are handled when the control renders as a toggle switch in .NET 11-or-later visual styles mode:
    • Left and center alignments are treated as left-aligned.
    • Right alignments are treated as right-aligned.

Customer Impact

  • Customers can now understand from the API docs that centered CheckAlign values do not center the toggle switch when using Appearance.ToggleSwitch. This clarifies the intended behavior and reduces confusion.

Regression?

  • No

Risk

  • Low

Test methodology

  • Manually

Test environment(s)

  • .net11.0.0-rc.1.26410.101
Microsoft Reviewers: Open in CodeFlow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> to CheckBox.CheckAlign and RadioButton.CheckAlign documenting that center alignments behave like left alignments, and right alignments behave like right alignments when rendered as a toggle switch.
  • Added XML <remarks> to RadioButton.Appearance describing 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.

@KlausLoeffelmann KlausLoeffelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks!

@KlausLoeffelmann
KlausLoeffelmann merged commit 7d033a9 into dotnet:main Aug 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting the CheckAlign as TopCenter/BottomCenter/MiddleCenter is not working for RadioButton/CheckBox control with Appearance as ToggleSwitch

3 participants