Freigeben über


Control.AccessibleName-Eigenschaft

Ruft den Namen des von Clientprogrammen für Eingabehilfen verwendeten Steuerelements ab oder legt diesen fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
<LocalizableAttribute(True)> _
Public Property AccessibleName As String
'Usage
Dim instance As Control
Dim value As String

value = instance.AccessibleName

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

/** @property */
public void set_AccessibleName (String value)
public function get AccessibleName () : String

public function set AccessibleName (value : String)

Eigenschaftenwert

Der Name des von Clientprogrammen für Eingabehilfen verwendeten Steuerelements. Der Standardwert ist NULL (Nothing in Visual Basic).

Hinweise

Die AccessibleName-Eigenschaft ist eine Bezeichnung, die das Objekt in dessen Container kurz beschreibt und identifiziert, z. B. der Text auf einem Button, der Name eines MenuItem oder eine neben einem TextBox-Steuerelement angezeigte Bezeichnung.

Weitere Informationen zu Eigenschaften von zugreifbaren Objekten finden Sie in der MSDN Library unter https://msdn.microsoft.com/library/deu. im Thema "Content of Descriptive Properties".

Beispiel

Im folgenden Codebeispiel wird eine Instanz der von einer CheckBox abgeleiteten Klasse MyCheckBox erstellt. Deren Image-Eigenschaft wird ein Image zugewiesen sowie die AccessibleName-Eigenschaft und die AccessibleDescription-Eigenschaft festgelegt, da die Text-Eigenschaft NULL (Nothing in Visual Basic) ist. In diesem Beispiel muss ein Form mit der Bezeichnung MyForm vorhanden sein.

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

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

Control-Klasse
Control-Member
System.Windows.Forms-Namespace
Control.AccessibleDescription-Eigenschaft
AccessibleRole
Control.AccessibleDefaultActionDescription-Eigenschaft
AccessibleObject.Name-Eigenschaft