Skip to content

Add InternalRaiseAutomationNotification in WmDateChanged of the MonthCalendar #13707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Jul 16, 2025

Fixes #13657

Proposed changes

  • Send MSAA focus notification in WmDateChanged of the MonthCalendar so that the MonthCalendar remains in the Focused state when switching dates with the keyboard

Customer Impact

  • NVDA can announce the correct information for the calendar date on which keyboard focus is shifting

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

NVDA cannot announce the correct information for the calendar date

Bug_13657_A11y_WinForms.NETRuntime_CommonControl2_InfoAndRelationships.mp4

After

The calendar date can be announced and the MonthCalendar can be focused with NVDA

NVDA-2024.4.2.mp4

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-preview.7.25365.101
Microsoft Reviewers: Open in CodeFlow

@LeafShi1
Copy link
Member Author

Draft the PR because Narrator will announce the calendar date 2 times after the changes

image

Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.90768%. Comparing base (118a672) to head (acb2d59).
Report is 9 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13707         +/-   ##
===================================================
+ Coverage   76.82947%   76.90768%   +0.07820%     
===================================================
  Files           3257        3260          +3     
  Lines         642592      643097        +505     
  Branches       47565       47601         +36     
===================================================
+ Hits          493700      494591        +891     
+ Misses        145232      144836        -396     
- Partials        3660        3670         +10     
Flag Coverage Δ
Debug 76.90768% <100.00000%> (+0.07820%) ⬆️
integration 19.02528% <100.00000%> (+0.03509%) ⬆️
production 51.57816% <100.00000%> (+0.13649%) ⬆️
test 97.42152% <ø> (+0.00329%) ⬆️
unit 48.95629% <100.00000%> (+0.13558%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeafShi1 LeafShi1 removed the draft draft PR label Jul 17, 2025
@LeafShi1 LeafShi1 marked this pull request as ready for review July 17, 2025 09:23
Copy link
Contributor

@Copilot Copilot AI left a comment

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 enhances accessibility support for the MonthCalendar control by adding automation notifications when the selected date changes. The change ensures that screen readers like NVDA can properly announce date changes when users navigate the calendar with keyboard inputs.

Key changes:

  • Adds automation notification calls in the WmDateChanged method to notify accessibility tools when calendar focus/selection changes
  • Introduces a new app context switch to control this behavior
  • Uses both legacy MSAA events and modern UIA notifications for broader compatibility

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
MonthCalendar.cs Adds automation notification logic in WmDateChanged method with app context switch guard
LocalAppContextSwitches.cs Defines new app context switch for enabling MonthCalendar automation notifications
Comments suppressed due to low confidence (1)

src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs:29

  • The switch name contains 'RichTextBox' but should reference 'MonthCalendar' since this switch is for MonthCalendar automation notifications. It should be 'System.Windows.Forms.MonthCalendar.EnableMonthCalendarAutomationNotification'.
    internal const string EnableMonthCalendarAutomationNotificationSwitchName = "System.Windows.Forms.RichTextBox.EnableMonthCalendarAutomationNotification";

LeafShi1 and others added 3 commits July 21, 2025 09:44
…Switches/LocalAppContextSwitches.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LeafShi1 LeafShi1 force-pushed the Issue_13657_NVDA-announce_MonthCalendar branch from fa2437f to 728b2c6 Compare July 22, 2025 11:04
merriemcgaw
merriemcgaw previously approved these changes Jul 23, 2025
@LeafShi1
Copy link
Member Author

@merriemcgaw Regarding this PR, I need to correct a mistake

Turning on the existing switch AppContextSwitches.NoClientNotifications will turn on MSAA notifications, and NVDA can read calendar date information, but it will also disable UIA notifications, causing Narrator to not focus on MonthCalendar.

I updated the PR, adding MSAA events to MonthCalendar while retaining the original UIA events, so that both tools can read cell content normally, please review again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy