Control.AccessibleDescription 屬性

定義

取得或設定協助工具用戶端應用程式使用之控制項的描述。Gets or sets the description of the control used by accessibility client applications.

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

屬性值

協助工具用戶端應用程式使用之控制項的描述。The description of the control used by accessibility client applications. 預設為 nullThe default is null.

範例

下列程式碼範例會建立 CheckBox 衍生類別的實例,MyCheckBox,將 Image 指派給它的 Image 屬性,並設定 AccessibleNameAccessibleDescription 屬性,因為 Text 屬性是 nullThe following code example creates an instance of a CheckBox derived class, MyCheckBox, assigns it an Image to its Image property and sets the AccessibleName and AccessibleDescription properties, because the Text property is null. 這個範例需要您具有名為 MyFormFormThis example requires that you have a Form named 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 屬性會提供有關物件視覺外觀的文字描述。An object's AccessibleDescription property provides a textual description about an object's visual appearance. 描述主要是用來為低願景或盲人使用者提供更高的內容,但也可以用於內容搜尋或其他應用程式。The description is primarily used to provide greater context for low-vision or blind users, but can also be used for context searching or other applications.

如果描述不明顯,或是根據物件的 AccessibleNameAccessibleRoleStateValue 屬性而重複,就需要 AccessibleDescription 屬性。The AccessibleDescription property is needed if the description is not obvious, or if it is redundant based on the object's AccessibleName, AccessibleRole, State, and Value properties. 例如,具有「確定」的按鈕不需要其他資訊,但顯示仙人掌圖片的按鈕會是。For example, a button with "OK" would not need additional information, but a button that shows a picture of a cactus would. 仙人掌 按鈕的 AccessibleNameAccessibleRole (也可能是 Help)屬性會描述其用途,但 AccessibleDescription 屬性會傳達較不明確的資訊,例如「顯示仙人掌圖片的按鈕」。The AccessibleName, and AccessibleRole (and perhaps Help) properties for the cactus button would describe its purpose, but the AccessibleDescription property would convey information that is less tangible, such as "A button that shows a picture of a cactus."

如需可存取物件屬性的詳細資訊,請參閱描述性屬性的內容For more information about properties of accessible objects, see Content of Descriptive Properties.

適用於

另請參閱