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 實例,並將 指派 Image 給其 Image 屬性,並設定 AccessibleNameAccessibleDescription 屬性,因為 Text 屬性為 nullMyCheckBox 此範例需要您有 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如果描述不明顯,或是根據物件的 AccessibleNameAccessibleRoleStateValue 屬性來備援,則需要屬性。 例如,具有 「OK」 的按鈕不需要其他資訊,但顯示 cactus 圖片的按鈕會是 。 AccessibleName、 和 (AccessibleRole ,而且可能 Help) cactus 按鈕的屬性會描述其用途,但 AccessibleDescription 屬性會傳達較不具形的資訊,例如「顯示 cactus 圖片的按鈕」。

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

適用於

另請參閱