Control.AccessibleDescription 属性

获取或设置辅助功能客户端应用程序使用的控件说明。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
<LocalizableAttribute(True)> _
Public Property AccessibleDescription As String
用法
Dim instance As Control
Dim value As String

value = instance.AccessibleDescription

instance.AccessibleDescription = value
[LocalizableAttribute(true)] 
public string AccessibleDescription { get; set; }
[LocalizableAttribute(true)] 
public:
property String^ AccessibleDescription {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_AccessibleDescription ()

/** @property */
public void set_AccessibleDescription (String value)
public function get AccessibleDescription () : String

public function set AccessibleDescription (value : String)

属性值

辅助功能客户端应用程序使用的控件说明。默认为 空引用(在 Visual Basic 中为 Nothing)。

备注

对象的 AccessibleDescription 属性提供关于对象的可视外观的文字说明。说明主要用来为视力较差的用户或盲人用户提供更大的上下文,但也可以用于上下文搜索或其他应用程序中。

如果说明不明显,或者如果基于对象的 AccessibleNameAccessibleRoleStateValue 属性它是多余的,则需要 AccessibleDescription 属性。例如,显示“确定”的按钮不需要附加信息,但是显示仙人掌图片的按钮却需要。仙人掌按钮的 AccessibleNameAccessibleRole(也许还有 Help)属性描述其目的,但 AccessibleDescription 属性传达不太明确的信息,比如“一个显示仙人掌图片的按钮”。

有关辅助性对象的属性的更多信息,请参见位于 https://www.microsoft.com/china/msdn/library. 上的 MSDN Library 中的“Content of Descriptive Properties”(描述性属性的内容)主题。

示例

下面的代码示例创建 CheckBox 派生类的一个实例 MyCheckBox,将一个 Image 分配给它的 Image 属性,并设置 AccessibleNameAccessibleDescription 属性,因为 Text 属性为 空引用(在 Visual Basic 中为 Nothing)。该示例要求有一个名为 MyFormForm

Public Sub New()
   ' Create a 'MyCheckBox' control and 
   ' display an image on it. 
   Dim myCheckBox As New MyCustomControls.MyCheckBox()
   myCheckBox.Location = New Point(5, 5)
   myCheckBox.Image = Image.FromFile( _
     Application.CommonAppDataPath + "\Preview.jpg")

   ' Set the AccessibleName property
   ' since there is no Text displayed. 
   myCheckBox.AccessibleName = "Preview"

   ' Set the AccessibleDescription text.
   myCheckBox.AccessibleDescription = _
     "A toggle button used to show the document preview."
   Me.Controls.Add(myCheckBox)
End Sub
public MyForm()
{
   // Create a 'MyCheckBox' control and 
   // display an image on it.
   MyCustomControls.MyCheckBox myCheckBox = 
      new MyCustomControls.MyCheckBox();
   myCheckBox.Location = new Point(5,5);
   myCheckBox.Image = Image.FromFile(
     Application.CommonAppDataPath + "\\Preview.jpg");

   // Set the AccessibleName property
   // since there is no Text displayed.
   myCheckBox.AccessibleName = "Preview";
   myCheckBox.AccessibleDescription =
     "A toggle button used to show the document preview.";
   this.Controls.Add(myCheckBox);
}
public:
   MyForm()
   {
      // Create a 'MyCheckBox' control and
      // display an image on it.
      MyCustomControls::MyCheckBox^ myCheckBox = gcnew MyCustomControls::MyCheckBox;
      myCheckBox->Location = Point(5,5);
      myCheckBox->Image = Image::FromFile( String::Concat( Application::CommonAppDataPath, "\\Preview.jpg" ) );
      
      // Set the AccessibleName property
      // since there is no Text displayed.
      myCheckBox->AccessibleName = "Preview";
      myCheckBox->AccessibleDescription = "A toggle button used to show the document preview.";
      this->Controls->Add( myCheckBox );
   }
public MyForm()
{
    // Create a 'MyCheckBox' control and 
    // display an image on it.
    MyCustomControls.MyCheckBox myCheckBox = 
        new MyCustomControls.MyCheckBox();
    myCheckBox.set_Location(new Point(5, 5));
    myCheckBox.set_Image(Image.FromFile(Application.get_CommonAppDataPath() 
        + "\\Preview.jpg"));
    // Set the AccessibleName property
    // since there is no Text displayed.
    myCheckBox.set_AccessibleName("Preview");
    myCheckBox.set_AccessibleDescription(
        "A toggle button used to show the document preview.");
    this.get_Controls().Add(myCheckBox);
} //MyForm

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Control 类
Control 成员
System.Windows.Forms 命名空间
AccessibleName
AccessibleRole
Control.AccessibleDefaultActionDescription 属性
AccessibleObject.Description 属性