| | |
Dropping a DataObject from Win form to desktop.
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
Hello there, I have created and application where the items in a ListView will be dragged and dropped over the desktop. So far, I was able to implement the drag but cannot drop the item. The function I used should be detected by windows but it cannot register the drop on the desktop. Here is my code:
I can't find any article that could enlighten me. I've been stuck in this code for days now. What seems to be the problem?
C# Syntax (Toggle Plain Text)
private void listview_ItemDrag(object sender, ItemDragEventArgs e){ DataObject object = new DataObject() string f = listview.SelectedItems[0].Text; object.SetData(DataFormats.FileDrop, f); DoDragDrop(object, DragDropEffects.All); }
I can't find any article that could enlighten me. I've been stuck in this code for days now. What seems to be the problem?
An Avalanche In D Minor
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Im guessing because your object doesnt contain a file, it contains a filename, and you cant just put a string object to desktop.
I googled found plenty of examples, which work - i would suggest you do the same.
I googled found plenty of examples, which work - i would suggest you do the same.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Well the first I found was a URL dropper, and he does a heck of a lot more than you've shown code for, including creating the file so it can be written to desktop.
While the file he writes is a shortcut, the principal is the same.
While the file he writes is a shortcut, the principal is the same.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Other Threads in the C# Forum
- Previous Thread: saving arrays
- Next Thread: C# Coding for Access Database In Server
| Thread Tools | Search this Thread |
.net 2007 access algorithm array barchart bitmap box broadcast c# camera check checkbox client combobox control conversion cs4 csharp custom customactions database datagrid datagridview dataset date datetime degrees development draganddrop drawing encryption enum event eventcloseformc# excel file form format forms function gdi+ handler httpwebrequest image index input install java keypress label list listbox listener listview load mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting resolved. richtextbox search security server sleep socket sql statistics stream string table text textbox thread time timer update usercontrol validation view visual visualstudio webbrowser windows winforms wordautomation wpf xml






