Fix UIA state announcements for CheckBox #14674
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves accessibility state announcements for WinForms CheckBox and RadioButton by switching from UIA property-changed events to UIA Notification events, aiming for more reliable consumption by screen readers (notably NVDA) and more concise Narrator output.
Changes:
- Update
CheckBoxandRadioButtonto raise UIA notifications (with explicit state text) instead of UIA property-changed events in the affected paths. - Add new SR resource strings for the announced state text and propagate them to localized
.xlffiles. - Extend/adjust unit tests to validate that UIA notifications are raised and legacy UIA event/property-changed calls are not.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/CheckBox.cs | Replaces UIA property-changed/event signaling with UIA notifications and announces explicit state text. |
| src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/RadioButton.cs | Raises “checked” notification on check and adds “pressed” notification when clicking an already-checked radio button. |
| src/test/unit/System.Windows.Forms/System/Windows/Forms/CheckBoxTests.cs | Updates assertions to expect UIA notification calls and validates notification text. |
| src/test/unit/System.Windows.Forms/System/Windows/Forms/RadioButtonTests.cs | Updates assertions to expect UIA notification calls and adds a test for the “pressed” notification scenario. |
| src/System.Windows.Forms/Resources/SR.resx | Adds new SR entries for announcement text; also includes an unrelated whitespace change that ripples into localization state changes. |
| src/System.Windows.Forms/Resources/xlf/SR.*.xlf | Adds new trans-units for the announcement text and reflects a generated translation-state change for an unrelated existing string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2d4f33e to
87bfa20
Compare
|
The changes in this PR enable both Narrator and NVDA to correctly announce state changes for the CheckBox. However, the monitoring of Native Win32 CheckBox controls do not themselves raise the specific Recording.2026-06-26.173702.mp4@KlausLoeffelmann What do you think? |
Fixes #14669
Root Cause
PropertyChangenotifications raised viaRaiseAutomationEventwere not reliably consumed by NVDA for this scenario.Proposed changes
RaiseAutomationNotificationfor CheckBox/RadioButton state announcements in the affected path.Customer Impact
Regression?
Risk
Screenshots
Before
Screen readers could miss state-change announcements in this path.
Before_change_Narrator.mp4
Before_change_NVDA.mp4
After
Screen readers consistently receives checked/not checked announcements.
After_change_Narrator.mp4
After_change_NVDA.mp4
Test methodology
Test environment(s)