Skip to content

Conversation

@merriemcgaw
Copy link
Member

Additional changes for WinForms for .NET 4.7.1 Accessibility compat changes.

Additional changes for the Property Grid plus some additional tweaks.
@msftclas
Copy link

@merriemcgaw,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

Added blurb for Nikola's bug and overall UIAutomation improvements.
Copy link

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merriemcgaw, just a couple of additional comments/corrections. Once they're made, I think that this is ready to merge.

For an overview of UI automation, see the [UI Automation Overview](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-overview).

__Added support for UI Automation patterns and properties__

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me that it might be good to add the following at the end of line 29:
These accessibility changes are enabled by default on Windows Forms applications that target the .NET Framework 4.7.1 or later.

-


### Affected APIs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs the following:

  • Not detectable via API analysis

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean for me to add it to the section title?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merriemcgaw, no, not to the section title. To the section text:

Affected APIs

  • Not detectable via API analysis


__Added support for UI Automation patterns and properties__

Accessibility clients can take advantage of new WinForms accessibility functionality by using common, publicly described invocation patterns. These is not WinForms-specific. For instance, accessibility clients can call the QueryInterface method on the IAccessible interface (MAAS) to obtain an IServiceProvider interface. If this interface is available, clients can use its QueryService method to request an IAccessibleEx interface. For more information, see [Using IAccessibleEx from a Client](https://msdn.microsoft.com/en-us/library/windows/desktop/dd561924(v=vs.85).aspx). Starting with the .NET Framework 4.7.1, IServiceProvider and [IAccessibleEx]( https://msdn.microsoft.com/en-us/library/windows/desktop/dd561898(v=vs.85).aspx) (where applicable) are available for WinForms accessibility objects.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These is --> These patterns are

@merriemcgaw
Copy link
Member Author

@rpetrusha I want to confirm that the xrefs I added were done correctly. It doesn't appear to render well in the editor but I didn't know if our pre-publishing process could fix them. They are both in the UIA patterns and properties section and render literally as xref:System.Windows.Automation.ControlType.MenuItem?displayProperty=fullName with no formatting or links. It just seems odd to me.

@rpetrusha
Copy link

@merriemcgaw, the xrefs don't look good here, but should render once they're migrated to the dotnet/docs repo and published on docs.microsoft.com. This allows the fully qualified type or member name to display, rather than just the type or member name.



### Affected APIs
### Affected APIs not detectable via API analysis

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merriemcgaw, I apologize -- I completely overlooked the list of affected APIs. "not detectable via API analysis" should be removed. Otherwise, this looks good and is ready to merge.

@merriemcgaw merriemcgaw merged commit 96a48f3 into microsoft:master Sep 21, 2017
In order for the application to benefit from these changes, it must run on the .NET Framework 4.7.1 or later. The application can benefit from these changes in either of the following ways:
- It is recompiled to target the .NET Framework 4.7.1.
- It is recompiled to target the .NET Framework 4.7.1. These accessibility changes are enabled by default on Windows Forms applications that target the .NET Framework 4.7.1 or later.
- It opts out of the legacy accessibility behaviors by adding the following [AppContext Switch](https://docs.microsoft.com/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element) to the ```<runtime>``` section of the app config file and setting it to false, as the following example shows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"app.config" file - this is a literal file name, shouldn't it contain a dot?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, great catch Tanya. I never would have seen that!

- The `T:System.Windows.Forms.ToolStripDropDownItem` control supports [AccessibleEvents](https://docs.microsoft.com/dotnet/api/system.windows.forms.accessibleevents) indicating StateChange and NameChange when drop down is expanded or collapsed.
- The `T:System.Windows.Forms.ToolStripDropDownButton` control has a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property value of <xref:System.Windows.Automation.ControlType.MenuItem?displayProperty=fullName>
- The `T:System.Windows.Forms.DataGridViewCheckBoxCell` control supports the [Toggle Pattern](https://docs.microsoft.com/dotnet/api/system.windows.automation.togglepattern)
- The `T:System.Windows.Forms.NumericUpDown` and `T:System.Windows.Forms.DomainUpDown` controls support the [Name](https://docs.microsoft.com/dotnet/api/system.windows.automation.automationelement.nameproperty) and have a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-spinner-control-type) of <xref:System.Windows.Automation.ControlType.Spinner?displayProperty=fullName> and have support for the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet point is unfinished! - support for what?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually turned out to be leftover text from me rephrasing that sentence six times. Thanks for the catch!

- The __Details__ button in the error dialog that is displayed when the user enters an incorrect value in the T:System.Windows.Forms.PropertyGrid control supports the Expand/Collapse pattern, state and name change notifications, and a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property with a value of <xref:System.Windows.Automation.ControlType.MenuItem?displayProperty=fullName>.
- The [AccessibleRole](https://docs.microsoft.com/dotnet/api/system.windows.forms.accessiblerole) of rows in PropertyGrid control have changed from "Row" to "Cell". The cell maps to UIA ControlType "DataItem", which allows it to support appropriate keyboard shortcuts and Narrator announcements.
- The __Details__ button in the error dialog that is displayed when the user enters an incorrect value in the `T:System.Windows.Forms.PropertyGrid` control supports the [Expand/Collapse pattern](https://docs.microsoft.com/dotnet/framework/ui-automation/implementing-the-ui-automation-expandcollapse-control-pattern), state and name change notifications, and a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property with a value of <xref:System.Windows.Automation.ControlType.MenuItem?displayProperty=fullName>.
- The message pane displayed when the __Details__ button of the error dialog is now keyboard accessible and allows Narrator to announce the content of the error message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..when the Details button of the error dialog IS CLICKED(?) is now...

- The __Details__ button in the error dialog that is displayed when the user enters an incorrect value in the `T:System.Windows.Forms.PropertyGrid` control supports the [Expand/Collapse pattern](https://docs.microsoft.com/dotnet/framework/ui-automation/implementing-the-ui-automation-expandcollapse-control-pattern), state and name change notifications, and a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property with a value of <xref:System.Windows.Automation.ControlType.MenuItem?displayProperty=fullName>.
- The message pane displayed when the __Details__ button of the error dialog is now keyboard accessible and allows Narrator to announce the content of the error message.
- The [AccessibleRole](https://docs.microsoft.com/dotnet/api/system.windows.forms.accessiblerole) of rows in `T:System.Windows.Forms.PropertyGrid` control have changed from "Row" to "Cell". The cell maps to UIA ControlType "DataItem", which allows it to support appropriate keyboard shortcuts and Narrator announcements.
- The `T:System.Windows.Forms.PropertyGrid` control rows which represent header items when the has a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` have a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property value <xref:System.Windows.Automation.ControlType.Button?displayProperty=fullName>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing noun here - "items when the ?? has"

- The message pane displayed when the __Details__ button of the error dialog is now keyboard accessible and allows Narrator to announce the content of the error message.
- The [AccessibleRole](https://docs.microsoft.com/dotnet/api/system.windows.forms.accessiblerole) of rows in `T:System.Windows.Forms.PropertyGrid` control have changed from "Row" to "Cell". The cell maps to UIA ControlType "DataItem", which allows it to support appropriate keyboard shortcuts and Narrator announcements.
- The `T:System.Windows.Forms.PropertyGrid` control rows which represent header items when the has a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` have a [ControlType](https://docs.microsoft.com/dotnet/framework/ui-automation/ui-automation-support-for-the-menubar-control-type) property value <xref:System.Windows.Automation.ControlType.Button?displayProperty=fullName>
- The `T:System.Windows.Forms.PropertyGrid` control rows which represent header items when the has a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` support the [Expand/Collapse pattern](https://docs.microsoft.com/dotnet/framework/ui-automation/implementing-the-ui-automation-expandcollapse-control-pattern).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing noun here - "items when the ?? has"

- Improved keyboard navigation between the grid and the toolbar above it. Pressing "Shift-Tab" now selects the first ToolBar button, instead of the whole ToolBar
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode will now draw a focus rectangle around the toolstrip button which corresponds to the current `P:System.Windows.Forms.PropertySort` property value.
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode and with a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` will now display the background of category headers in a highly contrasting color.
- `T:System.Windows.Forms.PropertyGrid` controls better differentiates between toolstrip items with focus and the toolstrip item which indicates the current value of the `P:System.Windows.Forms.PropertySort` property. This fix consists of a High Contrast change and a change for non-High Contrast scenarios.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"toolstrip" should be sentence-cased - ToolStrip

- Improved keyboard navigation between the grid and the toolbar above it. Pressing "Shift-Tab" now selects the first ToolBar button, instead of the whole ToolBar
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode will now draw a focus rectangle around the toolstrip button which corresponds to the current `P:System.Windows.Forms.PropertySort` property value.
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode and with a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` will now display the background of category headers in a highly contrasting color.
- `T:System.Windows.Forms.PropertyGrid` controls better differentiates between toolstrip items with focus and the toolstrip item which indicates the current value of the `P:System.Windows.Forms.PropertySort` property. This fix consists of a High Contrast change and a change for non-High Contrast scenarios.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be "items" in both cases - "between items .. and ... items which indicate"

- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode will now draw a focus rectangle around the toolstrip button which corresponds to the current `P:System.Windows.Forms.PropertySort` property value.
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode and with a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` will now display the background of category headers in a highly contrasting color.
- `T:System.Windows.Forms.PropertyGrid` controls better differentiates between toolstrip items with focus and the toolstrip item which indicates the current value of the `P:System.Windows.Forms.PropertySort` property. This fix consists of a High Contrast change and a change for non-High Contrast scenarios.
- `T:System.Windows.Forms.PropertyGrid` control toolstrip items which indicates the current value of the `P:System.Windows.Forms.PropertySort` property support the [Toggle Pattern](https://docs.microsoft.com/dotnet/api/system.windows.automation.togglepattern).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"items which indicate"

- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode will now draw a focus rectangle around the toolstrip button which corresponds to the current `P:System.Windows.Forms.PropertySort` property value.
- `T:System.Windows.Forms.PropertyGrid` controls displayed in High Contrast mode and with a `P:System.Windows.Forms.PropertySort` property set to `F:System.Windows.Forms.PropertySory.Categorized` will now display the background of category headers in a highly contrasting color.
- `T:System.Windows.Forms.PropertyGrid` controls better differentiates between toolstrip items with focus and the toolstrip item which indicates the current value of the `P:System.Windows.Forms.PropertySort` property. This fix consists of a High Contrast change and a change for non-High Contrast scenarios.
- `T:System.Windows.Forms.PropertyGrid` control toolstrip items which indicates the current value of the `P:System.Windows.Forms.PropertySort` property support the [Toggle Pattern](https://docs.microsoft.com/dotnet/api/system.windows.automation.togglepattern).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this bullet point end with "where previously is did not", like the next bullet does?

- `T:System.Windows.Forms.Button` and `T:System.Windows.Forms.CheckBox` controls with `P:System.Windows.Forms.Control.FlatStyle` set to `F:System.Windows.Forms.FlatStyle.Standard`, which is the default style, now use OS-defined colors in High Contrast theme when selected. Previously, test and background colors were not contrasting and were hard to read.
- `T:System.Windows.Forms.Button`, `T:System.Windows.Forms.CheckBox`, `T:System.Windows.Forms.RadioButton`, `T:System.Windows.Forms.Label`, `T:System.Windows.Forms.LinkLabel` and `T:System.Windows.Forms.GroupBox` with`P:System.Windows.Forms.Control.Enabled` set to _false_, used a shaded color to rendered text in High Contrast themes, resulting in low contrast against the background. Now these controls use "Disabled Text" color defined by the OS. This fix applies to control with `P:System.Windows.Forms.Control.FlatStyle` set value other than `F:System.Windows.Forms.FlatStyle.System`. The latter controls are rendered by the OS.
- `T:System.Windows.Forms.Button` and `T:System.Windows.Forms.CheckBox` controls with `P:System.Windows.Forms.Control.FlatStyle` set to `F:System.Windows.Forms.FlatStyle.Standard`, which is the default style, now use OS-defined colors in High Contrast theme when selected. Previously, text and background colors were not contrasting and were hard to read.
- `T:System.Windows.Forms.Button`, `T:System.Windows.Forms.CheckBox`, `T:System.Windows.Forms.RadioButton`, `T:System.Windows.Forms.Label`, `T:System.Windows.Forms.LinkLabel` and `T:System.Windows.Forms.GroupBox` with`P:System.Windows.Forms.Control.Enabled` set to _false_, used a shaded color to rendered text in High Contrast themes, resulting in low contrast against the background. Now these controls use "Disabled Text" color defined by the OS. This fix applies to control with `P:System.Windows.Forms.Control.FlatStyle` property set to a value other than `F:System.Windows.Forms.FlatStyle.System`. The latter controls are rendered by the OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to RENDER text"

- `T:System.Windows.Forms.Button` and `T:System.Windows.Forms.CheckBox` controls with `P:System.Windows.Forms.Control.FlatStyle` set to `F:System.Windows.Forms.FlatStyle.Standard`, which is the default style, now use OS-defined colors in High Contrast theme when selected. Previously, test and background colors were not contrasting and were hard to read.
- `T:System.Windows.Forms.Button`, `T:System.Windows.Forms.CheckBox`, `T:System.Windows.Forms.RadioButton`, `T:System.Windows.Forms.Label`, `T:System.Windows.Forms.LinkLabel` and `T:System.Windows.Forms.GroupBox` with`P:System.Windows.Forms.Control.Enabled` set to _false_, used a shaded color to rendered text in High Contrast themes, resulting in low contrast against the background. Now these controls use "Disabled Text" color defined by the OS. This fix applies to control with `P:System.Windows.Forms.Control.FlatStyle` set value other than `F:System.Windows.Forms.FlatStyle.System`. The latter controls are rendered by the OS.
- `T:System.Windows.Forms.Button` and `T:System.Windows.Forms.CheckBox` controls with `P:System.Windows.Forms.Control.FlatStyle` set to `F:System.Windows.Forms.FlatStyle.Standard`, which is the default style, now use OS-defined colors in High Contrast theme when selected. Previously, text and background colors were not contrasting and were hard to read.
- `T:System.Windows.Forms.Button`, `T:System.Windows.Forms.CheckBox`, `T:System.Windows.Forms.RadioButton`, `T:System.Windows.Forms.Label`, `T:System.Windows.Forms.LinkLabel` and `T:System.Windows.Forms.GroupBox` with`P:System.Windows.Forms.Control.Enabled` set to _false_, used a shaded color to rendered text in High Contrast themes, resulting in low contrast against the background. Now these controls use "Disabled Text" color defined by the OS. This fix applies to control with `P:System.Windows.Forms.Control.FlatStyle` property set to a value other than `F:System.Windows.Forms.FlatStyle.System`. The latter controls are rendered by the OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This fix applies to controlS" - plural?

- The `T:Sysetm.Windows.Forms.MonthCalendar`control has added support for assistive technologies to access the control, inclding the ability for Narrator to read the value of the control when previously it could not.
- The `T:System.Windows.Forms.MonthCalendar` control has added support for assistive technologies to access the control, including the ability for Narrator to read the value of the control when previously it could not.
- The `T:System.Windows.Forms.CheckedListBox` control now notifies Narrator when the `P:System.Windows.Forms.CheckState` property has been changed. Previously, Narrator did not recieve notification and as a result users would not be informed that the `P:System.Windows.Forms.CheckState` had been updated.
- The `T:System.Windows.Forms.LinkLabel` control has changed the way it notifies Narrator of the text of in the control. Previously, Narrator announced this text twice and read "&" symbols as real text even though they are not visible to a user. The duplicated text was removed from the Narrator announcements, as well as unnecessary & symbols.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ampersand should be either in quotes in both places or with no quotes in both places :)

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.

4 participants