Export (0) Print
Expand All
Expand Minimize

Control.AccessibleName Property

Gets or sets the name of the control used by accessibility client applications.

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

[LocalizableAttribute(true)] 
public string AccessibleName { get; set; }
/** @property */
public String get_AccessibleName ()

/** @property */
public void set_AccessibleName (String value)

public function get AccessibleName () : String

public function set AccessibleName (value : String)

Not applicable.

Property Value

The name of the control used by accessibility client applications. The default is a null reference (Nothing in Visual Basic).

The AccessibleName property is a label that briefly describes and identifies the object within its container, such as the text in a Button, the name of a MenuItem, or a label displayed next to a TextBox control.

For more information about properties of accessible objects, see the "Content of Descriptive Properties" topic in the MSDN library at http://msdn.microsoft.com/library.

The 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 since the Text property is a null reference (Nothing in Visual Basic). This example requires that you have a Form named MyForm.

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

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft