AccessibleObject.DefaultAction AccessibleObject.DefaultAction AccessibleObject.DefaultAction AccessibleObject.DefaultAction Property

定义

获取描述对象默认操作的字符串。Gets a string that describes the default action of the object. 并非所有对象都有默认操作。Not all objects have a default action.

public:
 virtual property System::String ^ DefaultAction { System::String ^ get(); };
public virtual string DefaultAction { get; }
member this.DefaultAction : string
Public Overridable ReadOnly Property DefaultAction As String

属性值

对对象默认操作的描述;如果此对象没有默认操作,则为 nullA description of the default action for an object, or null if this object has no default action.

异常

无法检索控件的默认操作。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.

继承者说明

如果对象包装具有默认操作的系统控件,则默认实现将返回可访问对象的默认操作;否则,它将null返回。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 null. 只有执行操作的控件才应支持此方法。Only controls that perform actions should support this method. 并非所有对象都有默认操作,一些对象可能具有与其Value属性相关的默认操作,如以下示例中所示:选中的复选框的默认操作为 "取消选中" 且值为 "已选中"。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." 标记为 "Print" 的按钮的默认操作是 "按",没有任何值。A button labeled "Print" has a default action of "Press," with no value. 显示 "Printer" 的静态文本控件或编辑控件没有默认操作,但其值为 "Printer"。A static text control or an edit control that shows "Printer" has no default action, but would have a value of "Printer." 对象的DefaultAction属性应为谓词或短动词短语。An object's DefaultAction property should be a verb or a short verb phrase.

适用于

另请参阅