Export (0) Print
Expand All

AccessibleObject::DefaultAction Property

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

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
virtual property String^ DefaultAction {
	String^ get ();
}

Property Value

Type: System::String
A description of the default action for an object, or nullptr if this object has no default action.

ExceptionCondition
COMException

The default action for the control cannot be retrieved.

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 nullptr. 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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft