Skip to content

Report checked state for .NET Framework WinForms ToolStrip menu items using UIA#20485

Open
cary-rowen wants to merge 1 commit into
nvaccess:masterfrom
cary-rowen:fix-winforms-menuitem-checked-state
Open

Report checked state for .NET Framework WinForms ToolStrip menu items using UIA#20485
cary-rowen wants to merge 1 commit into
nvaccess:masterfrom
cary-rowen:fix-winforms-menuitem-checked-state

Conversation

@cary-rowen

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #19335

Summary of the issue:

Classic .NET Framework Windows Forms ToolStrip menu items exposed through the native UIA provider do not expose the TogglePattern. Their checked state is instead available through LegacyIAccessible, so NVDA does not currently report when these menu items are checked.

Description of user facing changes:

NVDA now reports when affected ToolStrip menu items are checked.

Description of developer facing changes:

No public API changes.

Description of development approach:

Extend the existing UIA menu item state handling with a LegacyIAccessible fallback. Standard UIA states remain authoritative. When UIA does not identify the item as checkable, NVDA reads the cached LegacyIAccessible state and adds the checkable and checked states when STATE_SYSTEM_CHECKED is present.

The fallback is implemented directly in NVDAObjects.UIA.MenuItem, the overlay class NVDA applies to UIA menu item controls. This avoids introducing a WinForms-specific overlay or .NET Framework version detection.

Testing strategy:

  • Manual testing with a .NET Framework 4.8 Windows Forms demo containing ToolStrip menu items with CheckOnClick = true, verifying that checked items are announced and other items are not falsely reported as checked.
  • Unit tests for the LegacyIAccessible checked-state fallback, items without the checked state, and precedence of standard UIA states.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@cary-rowen cary-rowen marked this pull request as ready for review July 11, 2026 20:43
@cary-rowen cary-rowen requested a review from a team as a code owner July 11, 2026 20:43
@cary-rowen cary-rowen requested a review from seanbudd July 11, 2026 20:43
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.

NVDA fails to announce checked state of ToolStripMenuItem in Windows Forms (.NET Framework 4.8)

1 participant