Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WinForms TabControl does not expose TabItem controls to UIAutomation #10408

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
leind375 opened this issue Dec 1, 2023 · 10 comments
Open

WinForms TabControl does not expose TabItem controls to UIAutomation #10408

leind375 opened this issue Dec 1, 2023 · 10 comments
Assignees
Labels
💥 regression-release Regression from a public release investigate Items we want to investigate before making a decision on an issue tenet-accessibility MAS violation, UIA issue; problems with accessibility standards
Milestone

Comments

@leind375
Copy link

leind375 commented Dec 1, 2023

.NET version

.NET 8

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, I believe it was working in .NET 6.

Issue description

For a WinForms TabControl, the tab page is exposed through UIAutomation but the TabItem controls are missing so there is no way for automations to switch between tabs.

Steps to reproduce

Create a WinForms app. Add a TabControl. By default it will have to pages. Run it. Walk the tree of the application. Tab page is there but no TabItem controls.

@leind375 leind375 added the untriaged The team needs to look at this issue in the next triage label Dec 1, 2023
@leind375 leind375 changed the title WinForms TabControl does not expose TabItem controls WinForms TabControl does not expose TabItem controls to UIAutomation Dec 1, 2023
@Tanya-Solyanik
Copy link
Member

@Olina-Zhang - Could you please verify when this scenario regressed? Consider using https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/navigate-among-ui-automation-elements-with-treewalker to build a sample

@elachlan elachlan added the tenet-accessibility MAS violation, UIA issue; problems with accessibility standards label Dec 1, 2023
@Olina-Zhang
Copy link
Member

@Tanya-Solyanik I cannot create a sample followed that document provided successfully. And test tabControls in Inspect by Navigation, it has same results in .Net 8.0 and .Net 6.0, TabItems under TabControl are in UIA tree and focused. @leind375 Could you please add more information to demonstrate your issue?

TabControl_Items.mp4

@LeafShi1
Copy link
Member

LeafShi1 commented Dec 4, 2023

@Olina-Zhang - Could you please verify when this scenario regressed? Consider using https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/navigate-among-ui-automation-elements-with-treewalker to build a sample

I tried to write an sample using Example 2, in the .netFramwork 4.8.1 project, TreeWalker can obtain the tabitem,
image

but In the .netcore project, TreeWalker obtain the panel.
image

Sample(the 'UIAutomationClient.dll' and 'UIAutomationTypes.dll' need to be referenced, I am referencing the dlls from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.8.1):
WindowsFormsApp3.zip

@Olina-Zhang
Copy link
Member

Thanks @LeafShi1. Verified it is regressed from .Net 6.0, cannot repro in .Net Core 3.1 and .Net 5.0.

.Net 6.0 behavior:
image

.Net 5.0:
image

@Olina-Zhang Olina-Zhang added the 💥 regression-release Regression from a public release label Dec 4, 2023
@merriemcgaw merriemcgaw added this to the .NET 9.0 milestone Dec 8, 2023
@merriemcgaw merriemcgaw removed the untriaged The team needs to look at this issue in the next triage label Dec 8, 2023
@SimonZhao888
Copy link
Member

When we use reverse lookup, TreeWalker can obtain the TabItem controls.
image
image
WinFormsApp71.zip

@leind375, hope this can help you to solve your problem.

@Tanya-Solyanik Tanya-Solyanik added the waiting-author-feedback The team requires more information from the author label Dec 18, 2023
@ghost ghost added the no-recent-activity label Jan 1, 2024
@ghost
Copy link

ghost commented Jan 1, 2024

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.

@leind375
Copy link
Author

leind375 commented Jan 3, 2024

Adding a comment to keep the defect open. The workaround will help us short term but would still like to see this fixed so we can avoid all the overrides we'll need to implement on future UI.

@ghost ghost removed waiting-author-feedback The team requires more information from the author no-recent-activity labels Jan 3, 2024
@leind375
Copy link
Author

The workaround above (using GetLastChild() and GetPreviousSibling() also has a defect - GetPreviousSibling is also returning children, not just siblings.

@SimonZhao888
Copy link
Member

SimonZhao888 commented Mar 5, 2024

The workaround above (using GetLastChild() and GetPreviousSibling() also has a defect - GetPreviousSibling is also returning children, not just siblings.

We need to modify the code appropriately, e.g. try to use TreeWalker(Condition condition), here is the example code:
1

@leind375, Will this meet your requirements?

@SimonZhao888 SimonZhao888 added the waiting-author-feedback The team requires more information from the author label May 24, 2024
@SimonZhao888 SimonZhao888 removed their assignment May 24, 2024
@leind375
Copy link
Author

leind375 commented Jun 7, 2024

@SimonZhao888 Yes, I can work with this for now. Would still like to see this fixed. Starting to add a lot of hacks in UIA code...

@dotnet-policy-service dotnet-policy-service bot removed waiting-author-feedback The team requires more information from the author no-recent-activity labels Jun 7, 2024
@lonitra lonitra modified the milestones: .NET 9.0, .NET 10.0 Jul 23, 2024
@merriemcgaw merriemcgaw modified the milestones: .NET 10.0, 10.0 Preview3 Mar 10, 2025
@merriemcgaw merriemcgaw modified the milestones: 10.0 Preview3, .NET 10.0 Mar 10, 2025
@Tanya-Solyanik Tanya-Solyanik added the investigate Items we want to investigate before making a decision on an issue label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-release Regression from a public release investigate Items we want to investigate before making a decision on an issue tenet-accessibility MAS violation, UIA issue; problems with accessibility standards
Projects
None yet
Development

No branches or pull requests

8 participants