Muokkaa

Jaa


Accelerator property

Sets or retrieves the accelerator key for a control.

Syntax

object.Accelerator [= String ]

The Accelerator property syntax has these parts:

Part Description
object Required. A valid object.
String Optional. The character to use as the accelerator key.

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 the tab order, rather than the Label itself, receives the focus.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.