语言

Control.AccessibleDescription 属性

定义

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

public:
 property System::String ^ AccessibleDescription { System::String ^ get(); void set(System::String ^ value); };
public string AccessibleDescription { get; set; }
public string? AccessibleDescription { get; set; }
member this.AccessibleDescription : string with get, set
Public Property AccessibleDescription As String

属性值

辅助功能客户端应用程序使用的控件的说明。 默认值为 null。

示例

下面的代码示例创建派生类的 CheckBox 实例, MyCheckBox将其 Image 分配给其 Image 属性并设置 AccessibleName 和 AccessibleDescription 属性,因为 Text 该属性为 null。 此示例要求你有一个 Form 命名名称 MyForm。

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.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 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

注解

对象的 AccessibleDescription 属性提供有关对象的视觉外观的文本说明。 该说明主要用于为低视力或盲人用户提供更大的上下文,但也可用于上下文搜索或其他应用程序。

AccessibleDescription如果说明不明显,或者基于对象的 AccessibleName、AccessibleRole属性State和Value属性冗余,则需要该属性。 例如,具有“确定”的按钮不需要其他信息,但显示仙人掌图片的按钮。 AccessibleName仙人掌按钮的和AccessibleRole(甚至可能Help)属性将描述其用途,但AccessibleDescription该属性将传达不太有形的信息,例如“显示仙人掌图片的按钮”。

有关可访问对象的属性的详细信息,请参阅 描述性属性的内容。

适用于

另请参阅