This documentation is archived and is not being maintained.

AccessibleObject.DefaultAction Property

Gets a string that describes the default action of the object. Not all objects have a default action.

[Visual Basic]
Public Overridable ReadOnly Property DefaultAction As String
[C#]
public virtual string DefaultAction {get;}
[C++]
public: __property virtual String* get_DefaultAction();
[JScript]
public function get DefaultAction() : String;

Property Value

A description of the default action for an object, or a null reference (Nothing in Visual Basic) if this object has no default action.

Exceptions

Exception Type Condition
COMException The default action for the control cannot be retrieved.

Remarks

The string describes the action that is performed on an object, not what the object does as a result. That is, a toolbar button that prints a document has a default action of "Press" rather than "Prints the current document." Do not confuse an object's default action with its value.

Notes to Inheritors:  The default implementation returns the accessible object's default action if the object wraps a system control that has a default action; otherwise, it returns a null reference (Nothing in Visual Basic). Only controls that perform actions should support this method. Not all objects have default actions, and some objects might have a default action that is related to its Value property, such as in the following examples: A selected check box has a default action of "Uncheck" and a value of "Checked." A cleared check box has a default action of "Check" and a value of "Unchecked." A button labeled "Print" has a default action of "Press," with no value. A static text control or an edit control that shows "Printer" has no default action, but would have a value of "Printer." An object's DefaultAction property should be a verb or a short verb phrase.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

AccessibleObject Class | AccessibleObject Members | System.Windows.Forms Namespace | Bounds | Description | Help | KeyboardShortcut | Name | Parent | Role | State | Value

Show: