AccessibleObject.DoDefaultAction 方法


执行与该辅助性对象相关的默认操作。Performs the default action associated with this accessible object.

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


无法执行该控件的默认操作。The default action for the control cannot be performed.


客户端可以通过检查对象的 @no__t 0 属性来检索对象的默认操作。Clients can retrieve the object's default action by inspecting an object's DefaultAction property. 客户端可以使用自动化(如果支持)而不是 DoDefaultAction 来执行对象的默认操作。A client can use automation (if supported) instead of DoDefaultAction to perform an object's default action. DoDefaultAction 提供一种简单的方法来执行对象的最常用操作。However, DoDefaultAction provides an easy way to perform an object's most commonly used action.


系统提供的用户界面元素所执行的默认操作取决于键盘状态。The default action performed by system-provided user interface elements depends on the keyboard state. 也就是说,如果调用 DoDefaultAction() 时,如果修改键(如 SHIFT、ALT 或 CTRL)关闭(通过用户操作或以编程方式),则默认操作可能不同于这些键未关闭的操作。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.