Bearbeiten

Freigeben über


AccessibleObject.DoDefaultAction Method

Definition

Performs the default action associated with this accessible object.

public:
 virtual void DoDefaultAction();
public virtual void DoDefaultAction ();
abstract member DoDefaultAction : unit -> unit
override this.DoDefaultAction : unit -> unit
Public Overridable Sub DoDefaultAction ()

Exceptions

The default action for the control cannot be performed.

Remarks

Clients can retrieve the object's default action by inspecting an object's DefaultAction property. A client can use automation (if supported) instead of DoDefaultAction to perform an object's default action. However, DoDefaultAction provides an easy way to perform an object's most commonly used action.

Notes to Inheritors

The default action performed by system-provided user interface elements depends on the keyboard state. That is, if a modifier key such as SHIFT, ALT, or CTRL is down (either by a user action or programmatically) when DoDefaultAction() is called, the default action might not be the same as when those keys are not down. Not all objects have a default action.

Applies to