ClickKey Property

Applies to TestComplete 12.60, last modified on September 17, 2018

Specifies the shortcut that will display the drop-down list of the component.

Declaration

componentPropObj.ClickKey
Read-Write Property Integer
componentPropObj     One of the objects listed in the Applies To section  

Applies To

This property applies to the following objects:

TcxButtonEditProperties, TcxMRUEditProperties

Description

Use the ClickKey property to specify the shortcut that will display the drop-down list of the component.

Property Value

An integer value that corresponds to the desired shortcut.

Note: At design time you specify the shortcut by selecting it from the drop-down list in the Properties window.

At run time, you specify the shortcut by assigning the appropriate integer value to the ClickKey property. See the Remarks section for more information on assigning shortcuts.

Remarks

In scripts, the shortcuts are presented by two-byte integer values having the following format:

Shortcut Format

The key code area is the virtual-key code of the desired key. To specify virtual-key codes of some keys, you can use VK_xxxx Win32 constants: VK_RETURN, VK_NEXT, VK_UP and so on. The available VK_xxxx constants are listed under the Win32API node in the Code Completion window.

The control-key code area specifies whether the key should be used with the Ctrl, Shift or Alt keys. This area can contain any combination of the following values:

Value Key
1 The Shift key.
2 The Alt key.
4 The Ctrl key.

You can combine these constants using the + operator to specify the combination of the control keys. If the control-key code area contains 0, this means no control key is used.

Example

The following sample code demonstrates how you can specify the shortcut at run time:

JavaScript, JScript

// Setting Ctrl+A
 
// Preparing the control-key code.
// It is the Ctrl constant moved 12 bits to the left.
CtrlKeyCode = 4 << 12;
// Assigning the shortcut
UserForms.UserForm1.cxMRUEdit1.Properties.ClickKey = CtrlKeyCode + 0x41; // Ctrl+A

Python

# Setting Ctrl+A

# Preparing the control-key code.
# It is the Ctrl constant moved 12 bits to the left.
CtrlKeyCode = 4 << 12
# Assigning the shortcut
UserForms.UserForm1.cxMRUEdit1.Properties.ClickKey = CtrlKeyCode + 0x41 # Ctrl+A

VBScript

' Setting Ctrl+A
 
' Preparing the control-key code.
' It is the Ctrl constant moved 12 bits to the left.
CtrlKeyCode = 4 * 4096
' Assigning the shortcut
UserForms.UserForm1.cxMRUEdit1.Properties.ClickKey = CtrlKeyCode + &H41 ' Ctrl+A

DelphiScript

// Setting Ctrl+A
var
  CtrlKeyCode : Variant;
begin
  // Preparing the control-key code.
  // It is the Ctrl constant moved 12 bits to the left.
  CtrlKeyCode := 4 shl 12;
  // Assigning the shortcut
  UserForms.UserForm1.cxMRUEdit1.Properties.ClickKey := CtrlKeyCode + $41; // Ctrl+A
end;

C++Script, C#Script

// Setting Ctrl+A
 
// Preparing the control-key code.
// It is the Ctrl constant moved 12 bits to the left.
CtrlKeyCode = 4 << 12;
// Assigning the shortcut
UserForms["UserForm1"]["cxMRUEdit1"]["Properties"]["ClickKey"] = CtrlKeyCode + 0x41; // Ctrl+A

See Also

OnButtonClick Event
Default Property (TcxEditButton)
ClearKey Property

Highlight search results