14

用户控件中有两个具有这些名称的属性:

1- AccessibleName 2- AccessibleRole

这些属性是什么以及它们在 win 表单应用程序中的用途是什么?我已经看过 MSDN 但不幸的是我无法理解他们的描述?

任何帮助将不胜感激

4

1 回答 1

21

Those are special attributes that can be used by screen readers or text-to-speech programs to make your program accessible to people with disabilities or who use assistive technology.

AccessibleName can be used to tell the user the element the cursor is sitting in. E.g. the assistive technology program can't determin which label around the text box belongs to it, but it's able to read that attribute (i.e. "what's the meaning of this box?"). A more detailed description can be added to AccessibleDescription.

In a similar way AccessibleRole describes the user (or tells the tool) what kind of control this is. This isn't as important for the standard controls, but imagine some custom button or hyperlink control: With this attribute it's able to tell "Hey, I'm clickable and I'm a button/link!".

于 2012-06-19T10:48:58.410 回答