Control.AccessibleDescription 屬性

定義

取得或設定協助工具用戶端應用程式使用之控制項的描述。

C#
public string AccessibleDescription { get; set; }
C#
public string? AccessibleDescription { get; set; }

屬性值

協助工具用戶端應用程式使用之控制項的描述。 預設為 null

範例

下列程式碼範例會建立衍生類別的 CheckBox 實例,並將 指派 Image 給其 Image 屬性,並設定 AccessibleNameAccessibleDescription 屬性,因為 Text 屬性為 nullMyCheckBox 此範例需要您有 Form 名為 的 MyForm

C#
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);
}

備註

物件的 AccessibleDescription 屬性提供物件視覺外觀的文字描述。 描述主要用於為低視或盲目使用者提供更大的內容,但也可用於內容搜尋或其他應用程式。

AccessibleDescription如果描述不明顯,或是根據物件的 AccessibleNameAccessibleRoleStateValue 屬性來備援,則需要屬性。 例如,具有 「OK」 的按鈕不需要其他資訊,但顯示 cactus 圖片的按鈕會是 。 AccessibleName、 和 (AccessibleRole ,而且可能 Help) cactus 按鈕的屬性會描述其用途,但 AccessibleDescription 屬性會傳達較不具形的資訊,例如「顯示 cactus 圖片的按鈕」。

如需可存取物件屬性的詳細資訊,請參閱 描述性屬性的內容

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另請參閱