event DropQueryEffect (Folder as ExShellFolder, KeyState as Long, Effect as Long)
Fired while the user is dragging a folder.

 TypeDescription 
   Folder as ExShellFolder A Folder object being droped.  
   KeyState as Long A long integer that represents the current state of certain keys on the keyboard.  
   Effect as Long A long integer that represents the desired drag-and-drop effect.  
Fires while a drag-and-drop operation is in progress. This event fires just prior to the end of a drag-and-drop operation (i.e., just before the DropFiles event). The Folder parameter is the target of the drag-and-drop operation. The KeyState holds the state of keys (such as Shift, Ctrl, Alt, etc.) at the end of the operation. Effect holds the desired effect on the files in the operation. The AllowDropFiles property determines whether or not the control will accept files dragged-and-dropped from another application (such as Explorer).

Here is a VB sample that shows you how to cancel a drag-and-drop operation if the target is the "My Computer" folder. In all other cases (targets), the operation is changed to "copy".

Private Sub ExFolderView1_DropQueryEffect(ByVal ExShellFolder As EXFOLDERVIEWLibCtl.IExShellFolder, ByVal KeyState As Long, Effect As Long)
   If ( Folder.DisplayName = "My Computer" )
      Effect = 0 ' cancel
   Else
      Effect = 1 ' copy
   End If
End Sub


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.