vb.net - Dragging a file With DDEffect Move to explorer. Explorer returns DragDropEffect Nothing -
whilst using next code dragdropeffects copy. when object dragged , dropped explorer dodragdrop correctly returns copy
dim ft specialized.stringcollection = new specialized.stringcollection ft.add(filename) dim drag_dat dataobject = new dataobject(dataformats.filedrop) drag_dat.setfiledroplist(ft) dim deffect dragdropeffects = me.dodragdrop(drag_dat, dragdropeffects.copy) deffect="copy"
when alter next line move, dodragdrop returns nothing. file moved explorer isn't reporting moved. why this, windows using re-create delete method or something?
dim deffect dragdropeffects = me.dodragdrop(drag_dat, dragdropeffects.move) deffect="nothing"
i need able confirm file has been moved. i'm not looking work around, eg... delete original file if re-create successful can cause issues illustration dropping file chrome can read file list , in effect homecoming copy.
had same problem today , spent hr searching solution...
meanwhile have problem solved, you. nevertheless want leave solution here, others stumble on thread...
because none instead of move, can check if file picked explorer , moved elsewhere...
effect = treeview1.dodragdrop(dobj, dragdropeffects.copy or dragdropeffects.move) select case effect case dragdropeffects.copy case dragdropeffects.move ' never happenes case dragdropeffects.none ' trick ! if not io.file.exists(file) ' should done when moved.... ...... end if end select
vb.net
No comments:
Post a Comment