Another item for programmers, more on UIA and MSAA and developing accessible user interfaces, following on from using WPF/XAML with MSAA and UIA.
This is a super-quick guide to using WinForms to make UIs that work well with screenreaders like NVDA or Thunder or JAWS.
- You don’t need to do anything to
Button
,CheckBox
,MenuItem
orMenuStrip
controls – other than put some text on them! Image-only controls are no good. It’s fine if only the image is shown to the end user and the text is hidden. - You can correctly label content controls that don’t have a
Text
property, likeTextBox
,ListBox
,ListView
,ComboBox
,ProgressBar
and the like, in one of two ways:- Put a
Label
just before the control you want to label in the tab index order. TheText
on theLabel
labels the control. Use theTabIndex
property to make sure the order is correct. - Set the
AccessibleName
property on the content control itself. This labels the control for the screenreader.
- Put a
Groupbox
controls don’t label their contents, use one of the other techniques here.- You almost certainly want to avoid labelling
Panel
controls, since they are generally for layout, which is communicated to the screenreader user in other ways than labeling. - For
WebBrowser
controls you need to think about the content in terms of web accessibility – uselabel
elements, ARIA, and other HTML accessibility techniques. You might also need to label the actualWebBrowser
control on your form with aLabel
orAccessibleName
, just like any other content control.
Unsurprisingly, these techniques are basically the same as writing forms using the Windows C++ API, since WinForms is a wrapper round that.