DragEventArgs.Keystate

G

Guest

I am doing a drag-drop in a treeview. In the DragOver and DragDrop event
handlers, I check the KeyState (e.KeyState) to see if CTRL is pressed. When
I hold the CTRL key down, e.KeyState in the DragOver event handler = 9, and
in the DragDrop event handler it = 8. According to the documentation, it
should = 8. Does anyone know why it is 9 in DragOver?
 
S

Stoitcho Goutsev \(100\)

Nathan,

Because you hold the left mouse button down during dragging.

The number in the KeyState is bitwise OR of the possible bits you when you
drag hodling down the Ctrl key you have

the bit for the Ctrl set, which is numerically 8 and the bit for the left
mouse button bit, which is numerically 1

8 | 1 = 9
 
G

Guest

Ah, that makes sense. Thanks.

Stoitcho Goutsev (100) said:
Nathan,

Because you hold the left mouse button down during dragging.

The number in the KeyState is bitwise OR of the possible bits you when you
drag hodling down the Ctrl key you have

the bit for the Ctrl set, which is numerically 8 and the bit for the left
mouse button bit, which is numerically 1

8 | 1 = 9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top