Table of contents
TOC
折叠目录
展开目录

Accelerator 属性Accelerator Property

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

设置或检索控件的加速键语法对象加速服务[=字符串]加速器属性语法具有下列组成部分:Sets or retrieves the accelerator key for a control. Syntaxobject. Accelerator [= String ] The Accelerator property syntax has these parts:

部件Part说明Description
objectobject(所需)。对象有效。Required. A valid object.
StringString可选。用作加速键的字符。Optional. The character to use as the accelerator key.

备注若要指定加速键,加速器属性输入一个字符。在控件的属性表或代码中,您可以设置加速器。如果此属性的值包含一个以上字符时,字符串中的第一个字符将成为加速器的值。当使用加速键时,没有视觉反馈 (除了焦点) 以指示该控件启动了 Click 事件。例如,如果要加速键应用到命令按钮,用户看不在界面中按下的按钮。该按钮获得焦点,但是,当用户按加速键。如果加速器应用于标签标签tab 键次序中,而不是标签本身,后面的控件接收到焦点。Remarks To designate an accelerator key, enter a single character for the Accelerator property. You can set Accelerator in the control's property sheet or in code. If the value of this property contains more than one character, the first character in the string becomes the value of Accelerator. When an accelerator key is used, there is no visual feedback (other than focus) to indicate that the control initiated the Click event. For example, if the accelerator key applies to a CommandButton, the user will not see the button pressed in the interface. The button receives the focus, however, when the user presses the accelerator key. If the accelerator applies to a Label, the control following the Label in thetab order, rather than the Label itself, receives the focus.

© 2018 Microsoft