Making Your Windows Forms Applications Accessible to People with Disabilities

Microsoft Active Accessibility (MSAA) is a technology that makes computer programs more accessible to people who use accessibility aids. For developers, it also can expand the capabilities of testing tools and other specialized utilities. Detailed information on MSAA can be found at the MSAA web site.

What Does Active Accessibility Do?

Active Accessibility provides a standard way for accessibility aids to get information about user interface elements, and for programs to expose that information to the aids. For example, Active Accessibility provides these individual pieces of information:

  • Type of object
  • Name of object
  • Location of object
  • Current state of object

It also provides the following:

  • Notification of changes in the user interface by use of Windows events, and navigation (spatial and logical)
  • Standards that help program-developers and aid-developers ensure their products are compatible.
How Does Windows Forms Help?

MSAA defines an interface called IAccessible. This interface is the mechanism through which information is provided to accessibility aids. Windows Forms implements this interface for all of its controls and exposes a set of accessibility properties on each control (these can easily be set at design time or run time). This makes it much easier to build accessible applications. The properties are the following:

  • AccessibleName: The name of the control - for example, SaveButton
  • AccessibleDescription: A description of the purpose of the control - for example, "Press this button to save the customer"
  • AccessibleRole: The role of the control - for example, AccessibleRoles.PushButton

Windows Forms also maps other properties to their appropriate IAccessible properties - for instance, the HelpProvider property.

The following code shows how to set the AccessibleName and AccessibleDescription properties on a TextBox.


textBox1.Location = new System.Drawing.Point(16, 24)
textBox1.Text = "Hello Windows Forms World"
textBox1.AccessibleName = "TextEntryField"
textBox1.TabIndex = 0
textBox1.AccessibleDescription = "Please enter some text in the box"
textBox1.Size = new System.Drawing.Size(360, 20)
VB

View and run this sample.

 
VB Accessible

[Run Sample] | [View Source]


Copyright 2001 Microsoft Corporation. All rights reserved.