SetActionKey Method
Applies To
fpSpread control
Description
Sets the shortcut key or navigation key assigned to a specified action.
Syntax
BOOL CSpreadSheet::SetActionKey(long Action, BOOL fShift, BOOL fCtrl, short Key);
fpSpread.SetActionKey(ByVal Action As Long, ByVal fShift As Boolean, ByVal fCtrl As Boolean, ByVal Key As Integer) As Boolean
Parameters
The following parameters are available:
| Parameter | Description | ||
|---|---|---|---|
| Action | Action for which to set navigation or shortcut keys | ||
| Choose one of the following values: | |||
| Value | Constant | Description | |
| 0 | ActionKeyClear | Clears the active cell | |
| 1 | ActionKeyCurrent | Displays the current date and time in a date or time cell | |
| 2 | ActionKeyPopup | Displays a pop-up calendar in a date cell | |
| fShift | The state of the Shift key | ||
| fCtrl | The state of the Ctrl key | ||
| Key | Key assigned to the specified action. Use any virtual key code.Note If you use alphabetical keys, you must use uppercase letters for this parameter. | ||
Remarks
This method is applied to the entire workbook, including all sheets in the control.
To disable the action key, set the wKey parameter to 0.
| Note: Spread provides multiple ways to navigate within the sheet. We recommend that you do not choose a key sequence that duplicates the action keys that Spread uses for navigation. For a list of navigation keys that Spread uses, see "Navigation" in the printed User's Guide. |
Use the GetActionKey method to return the currently assigned navigation or shortcut key for a specific action.
Spread Designer
Choose the Book menu, then the Keys menu, and then the Action menu. Select the Action Keys tab in the Book Settings dialog box.
| Parameter | Items on Action Keys tab |
|---|---|
| Action | Action drop-down list box |
| fShift | Custom option button under Key Used and Capture Key Combination button |
| fCtrl | Custom option button under Key Used and Capture Key Combination button |
| Key | Option buttons under Key Used |
Return Type
True if successful; otherwise, False.
See Also
Changing or Turning Off the Action Keys
GetActionKey method
DLL Correspondence
SSSetActionKey function