![]() | Type | Description | ||
| KeyCode as Integer | An integer that represent the key code. | |||
| Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of shift is 6. |
The following VB sample displays the object's Properties dialog, when the user presses the F2 key:
Private Sub ExShellView1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
ExShellView1.Objects.Get (SelectedItems)
With ExShellView1.Objects
If (.Count > 0) Then
.Item(0).InvokeCommand ("Properties")
End If
End With
End If
End Sub
The following VB sample starts renaming the selected object, when the user presses the F2 key:
Private Sub ExShellView1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
ExShellView1.Objects.Get (SelectedItems)
With ExShellView1.Objects
If (.Count > 0) Then
.Item(0).InvokeRename
End If
End With
End If
End Sub