Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are referring to a situation similar to <strong>delete-on-paste</strong> in Windows Explorer where a file is not deleted from the source folder until a Paste operation occurs.</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb776904(VS.85).aspx#delete_on_paste" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb776904(VS.85).aspx#delete_on_paste</a></p> <h3>Easy Answer</h3> <p>If you are doing this within the same instance of the application, then this is referred to an <strong>optimized move</strong> where you can simply set a local flag (such as a boolean variable) to determine if it was successful.</p> <p><strong>Update:</strong> Yes, you can also check the results of the DoDragDrop method to determine if the drop was successful. Just make sure that your drop-handling code properly sets the Effect to None if there was an error completing the drop, or else your code with DoDragDrop will think that the drop was a success. This method will even work between two instances of your application.</p> <h3>Hard Answer</h3> <p>If you are doing this between two instances of your application, and you need to transfer more information that just whether or not the drop was successful, then you need to implement the OLE version of <code>IDataObject</code> so that the application instance that is the drop target completes the drag and drop, it can call SetData on the source object to send result information. This is complicated to do but is certainly possible.</p> <p>For more information on doing this, see these links:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx</a></p> <p><a href="http://blogs.msdn.com/b/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx" rel="nofollow">http://blogs.msdn.com/b/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload