Search code examples
listviewwindows-7vb6drag-and-dropoledragdrop

Drag and Drop External File onto VB6 ListView Control


I am trying to drop an external file (from windows file explorer) onto a ListView control. I have done this before but can't seem to get the events to fire.

My steps are as follows:

  • Create a ListView Control
  • Set the View property to 3 - lvwReport
  • Set the OLEDropMode property to 1 -ccOLEDropManual

I thought that was all I had to do but my ListView1_OLEDragDrop event does not fire.

I populated the ListView with a couple of items just in case.

I tried setting the Effect = vbDropEffectCopy in the ListView1_OLEDragOver and the ListView1_OLEGiveFeedback but this seems to have no effect either (this doesn't even change the cursor)

Note: I can get the StartDrag event to fire when dragging out of the control

Can someone confirm that this still works on windows 7?


Solution

  • It appears that dragging and dropping onto the ListView does not work when Running as Administrator.

    • When I try this in the IDE (which is set to run As Admin) it doesn't work.
    • If I use my compiled exe it works, but if I run my compiled exe as Admin (right click Run As Admin) it doesn't work.

    I don't know why is doesn't work however