System.Windows.Forms.QueryContinueDragEventArgs.KeyState Property

Gets the current state of the SHIFT, CTRL, and ALT keys.

Syntax

public int KeyState { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The bits that are set in the QueryContinueDragEventArgs.KeyState property identify the keys or mouse buttons that were pressed during the operation. For example, if the left mouse button is pressed, the first bit in the QueryContinueDragEventArgs.KeyState property is set. You can use the bitwise AND operator to test for a given key state.

The following table lists the bits that are set for a specified event.

1

The left mouse button.

2

The right mouse button.

4

The SHIFT key.

8

The CTL key.

16

The middle mouse button.

32

The ALT key.

By default, the Control.QueryContinueDrag event sets QueryContinueDragEventArgs.Action to DragAction.Drop if QueryContinueDragEventArgs.KeyState indicates that the left, middle, or right mouse button is pressed.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0