MSAA, UIA and WinForms in .Net

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 or MenuStrip 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, like TextBox, 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. The Text on the Label labels the control. Use the TabIndex property to make sure the order is correct.
    • Set the AccessibleName property on the content control itself. This labels the control for the screenreader.
  • 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 – use label elements, ARIA, and other HTML accessibility techniques. You might also need to label the actual WebBrowser control on your form with a Label or AccessibleName, 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.

MSAA, UIA and WPF

A technical note today for programmers.

Screenreaders (blind users) interact with Windows programs through accessibility APIs. The most modern is UI Automation. But the first, and possibly most important still, is MSAA, Microsoft Active Accessibility. Windows will supply information from one interface to the other system if required, so most of the time you shouldn’t have to worry too much.

I’ve been doing some .Net programs using WPF or XAML (that is, not WinForms) and here’s a quick guide to what I’ve found:

  • Buttons and CheckBoxes work fine just as they are. In fact, don’t set any Automation properties or you’ll get odd-looking controls in MSAA.
  • ListBox, ComboBox, TextBox, ProgressBar work fine for their contents just as they are. But:
  • Labels don’t label Listbox/ComboBox/TextBox/ProgressBar unless you use LabeledBy.

In C++ applications you associate labels (e.g. “Enter username:”) with the control they are labelling (e.g. a textbox for the username) by using tab order. The label with tab index N labels the control with tab index N+1. So label with tab index 0 provides the name to the combobox with tab index 1.

In WPF you have to set this explicitly using AutomationProperties.LabeledBy, like this:

<Label Content="A ListBox Control:" x:Name="lblList"></Label>
<ListBox AutomationProperties.LabeledBy="{Binding ElementName=lblList}">
  <TextBlock>Elephant</TextBlock>
  <TextBlock>Koala</TextBlock>
</ListBox>


Note the funky “Binding” code – you can’t just use the x:Name of the label. Notice also that your Label must have an x:Name! You can also use a TextBlock instead of a label. Generally the pattern is:

<TextThing Content=”The label for the other control” x:Name=”textThingLabel” />
<OtherControl AutomationProperties.LabeledBy=”{Binding ElementName=textThingLabel}” />


Anyway, that suffices for the basics of MSAA/UIA support for WPF if you’re writing .Net Windows applications.

Switch to WebbIE 4

I’ve had various reports of problems with users of Windows XP with ASDL modems that WebbIE 3 doesn’t start up. Also, Google search is broken. I’ve seized the opportunity to tell people who’ve mailed me to use the new WebbIE 4 instead, and that’s confirmed to me (after a bit of bugfixing) that it’s working and pretty much there.

I’ve therefore decided to push ahead with the official release of WebbIE 4, and with it the other new .Net-version programs – PDF Reader, BBC iPlayer Radio, and BBC Live Radio. I’ve removed all of these from the WebbIE MSI installer file that used to contain every program. I’ll continue to distribute this so the people can get the remaining programs, until I either convert then to .Net or build separate installers.

The front page of WebbIE therefore lists separate installers for the new .Net programs – WebbIE, PDF Reader, BBC iPlayer Radio and BBC Live Radio – and links to the updated MSI that still contains Podcatcher, Clock, Calendar, and RSS News Reader. I’ve also left the old WebbIE 3 installer still on the page.

A reminder of the advantages of the new .Net programs:

  • Per-user installation (ClickOnce or MSI) with automatic updates. Not having the latest version is the Number 1 reason for mailing me with a support query.
  • Working modern code that will keep working for another eleven years.
  • Better support for screenreaders through MSAA/UIA support.

It’s a bit of a journey, but I think it’s the right direction! Thank to everyone for feedback.

New WebbIE Development

Over the last two years I have been working to move the WebbIE programs from the old programming language they have been written in (Visual Basic 6) to the newer .Net. Users of NVDA and Thunder will find that the programs are easier to use and controls are better-labelled. The software will run more smoothly and reliably on modern machines, and be easier for me to manage.

This means that there are now new Beta versions of the new WebbIE 4 Web Browser and the BBC Live Radio program, which you download from here:

This is a significant change: for geeks think “Netscape to Firefox”. I’ve recoded pretty much all of it, which means many features have disappeared – unused ones, I hope – and some new ones have appeared, such as the start of support for accessibility features in HTML5. I’ll keep the old WebbIE installers and code around for anyone who wants them, but new .Net versions of everything will eventually be created.

I have also chosen to change how WebbIE is distributed. Instead of one single installer file, from which you can install whichever program you want, I am moving to different installers for each program. The main benefit of this is that this allows me to use a different installation system that will automatically update everyone when there is a new version: this will be a great help (especially for the BBC iPlayer programs.)

I will also be dropping some of the WebbIE programs, those which I think are least used. My plan is to drop:

  • Disk Explorer
  • Google Podcast and RSS Search
  • Gutenberg
  • I.E. Appearance Editor
  • Web Directory

This will eventually leave us with:

  • WebbIE web browser
  • The BBC programs
  • R.S.S. News Reader
  • PDF Reader
  • Clock
  • Calendar
  • Podcatcher
  • Radio Tuner

However, this depends on my doing a lot of work, so it might end up that more of the programs disappear, or are never updated. Which is fine if the old versions keep work: I’ll just split them out as separate installers for anyone who needs them.

So, please do try out the new Beta of WebbIE 4 and let me know of any problems or comments. Next time, details of what’s new in WebbIE 4.