dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.41k stars 980 forks source link

Consider updating AccessibleObject to allow enabling UIA and IAccessibleEx from custom controls #1834

Open M-Lipin opened 5 years ago

M-Lipin commented 5 years ago

At this moment there is no way to add/implement modern accessibility patterns for custom controls that inherit from Control other than implementing these from scratch.

Adding IAccessibleEx implementation requires to disable already existing internal IAccessibleEx implementation.

Implementing UIA also requires to override WndProc method which may be not trivial for C# developers.

So there are few ways to work around this: to open corresponding APIs to enable/disable UIA/IAccessibleEx-provided accessibility or enable modern accessibility implementation for all controls by default.

merriemcgaw commented 5 years ago

I absolutely love this idea @M-Lipin. As soon as we've addressed the known issues we should extend our abilities to our customers that are implementing their own accessibility enhancements.

merriemcgaw commented 5 years ago

I'm moving this to 5.0 since we're full up for 3.1 on accessibility, but I REALLY want to do this feature.

IrinaPykhova commented 2 years ago

@dreddy-work do you have any information for us, is that a real plan for .Net 7 or still tentative? We'd like to see some improvements in that direction: https://github.com/dotnet/winforms/discussions/6736

merriemcgaw commented 2 years ago

Thanks for popping this back on my radar @IrinaPykhova I will be sure to chat with @Tanya-Solyanik and the rest of the accessibility folks and do a deeper assessment. I really would like to get this in for .NET 7, but I can't offer a set in stone promise. I'll do my best though 😄

Draco1983 commented 1 month ago

Hi, I'm posting here to see if there is any concrete roadmap laid out already for this issue? At our company, we are looking to build some automated tests for a WinForms desktop application. We found out that WinForms provides built-in support for Microsoft Active Accessibility only, and that support for the newer UIA framework is given via compatibility providers. The way this all works out in practice, will make it harder to adopt some unified approaches. To give an example; for some WInForms controls the UIA.AutomationId is filled in and for others not. We will need to use the legacy MSAA access properties in a lot of cases we found out. It would be nice if WinForms would get the a higher level of support for e.g. the UIA.AutomationId. In WPF for ex, it is writeable on basically each control so you can fully use it as a standalone/dedicated property in test automation. This highly increases the test setup uniformity and stability. To have the UIA.AutomationId available as writeable in WinForms, would be a big win for our scenarios.

At this moment, we have some decisions to make on how to move forward with the test automation. So we would like to know if there is a planned commitment for this in the short term?