Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article is referenced directly by Microsoft Accessibility Insights for Windows. Microsoft Accessibility Insights for Windows can help spotlight many accessibility issues in UI, and guide you to the relevant UI framework-specific code sample to help you resolve the issue. Learn more about Microsoft Accessibility Insights for Windows.
Problem
When a screen reader moves to the control, its announcement does not include information relating to the control. For example, the purpose of the control, or in some cases, important supplemental information. As such, my customer is blocked from completing their task.
Suggested Fix
Typically, a control can expose important localized information programmatically, through use of the AutomationProperties class in markup. If that is not practical, then in some cases the AutomationProperties might be used in code-behind.
Code Sample: Using the AutomationProperties class in code-behind
Note that only a subset of the available AutomationProperties properties are shown in this example.
ResourceManager rm = MyAppNamespace.Properties.Resources.ResourceManager;
// Convey the purpose of the control in its Name.
AutomationProperties.SetName(MyControl, rm.GetString("MyControlName"));
// Important: Only set properties such as HelpText and ItemStatus if by doing
// so, the customer experience is enhanced. If the information exposed is not
// important, then related announcements can become a distraction to your
// customers.
// Convey information on how to interact with the control, or descriptive information
// about the control, in the HelpText.
AutomationProperties.SetHelpText(MyControl, rm.GetString("MyControlHelpText"));
// Convey the current status of the control in the ItemStatus.
AutomationProperties.SetItemStatus(MyControl, rm.GetString("MyControlItemStatus"));