471,350 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

DragEventArgs.Keystate

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?
Feb 21 '06 #1
2 4541
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
--
HTH
Stoitcho Goutsev (100)

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
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?

Feb 21 '06 #2
Ah, that makes sense. Thanks.

"Stoitcho Goutsev (100)" wrote:
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
--
HTH
Stoitcho Goutsev (100)

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
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?


Feb 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by SamSpade | last post: by
3 posts views Thread by Ajay Krishnan Thampi | last post: by
2 posts views Thread by Paul Ledger | last post: by
1 post views Thread by Chris Leffer | last post: by
3 posts views Thread by Uma sakshi | last post: by
3 posts views Thread by Gary Dunne | last post: by
7 posts views Thread by warbornster | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.