MouseHover event during drag and drop operations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am writing a classic, "Explorer"-like app in vb.net 2003 (dotnetfx1.1).

I have written code to handle the dragging and dropping of items from a
ListView on the right hand part of the form to a TreeView on the left part of
the form. When the user pauses over a node in the TreeView in the middle of a
drag and drop operation, I'd like the node to automatically expand to reveal
the child nodes, just as you see in many commercial applications. However, I
am unable to create this behaviour because the TreeView control does not fire
the MouseHover event whilst in the middle of a drag and drop operation.

Are there any workarounds to this?

Regards,

James
 
James,

During drag and drop operations no mouse messages are sent. In this case
windows enters special modal loop and sends special drag&drop notifcations
to the window under the mouse curosor if registered as potential drop
target.

In windows forms instead of expecting mouse events during D&D you need to
process: DragEnter, DragLeave, DragOver and DragDrop events. DragOver is
equivalent to MouseHover.
 
Thanks for this.

How would I simulate a MouseHover event during the DragOver event?

James
 
Well, I have a similar issue. For my app, I would like to process keyboard
input and or the mouse wheel during a drop operation. DoDragDrop eats all
mouse and keybouard input. The only thing I can get at is mouse button state
and the esc, ctrl, alt and shift keys which MS views as primarily relevant
for a dragdrop operation.

So... how can I get mouse wheel and keypress events or state from within
DragHover or anywhere else in the few methods available for handling drag
drop?
 
Back
Top