|
-
May 28th, 2012, 03:23 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Drag and Drop
I have this code to add an item to my listbox, it works when dragging items from my hard drive but attachments in outlook can't be dragged and dropped.
What is wrong?
vb.net Code:
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim droppedFilePaths As String() = TryCast(e.Data.GetData(DataFormats.FileDrop, True), String())
For Each droppedFilePath As String In droppedFilePaths
Dim fileItem As New ListBoxItem()
fileItem.Content = System.IO.Path.GetFileNameWithoutExtension(droppedFilePath)
fileItem.ToolTip = droppedFilePath
listbox.Items.Add(fileItem)
Next
End If
-
May 28th, 2012, 03:45 PM
#2
Thread Starter
Hyperactive Member
-
May 30th, 2012, 02:40 PM
#3
Re: Drag and Drop
What happens when you debug?
-
May 30th, 2012, 04:15 PM
#4
Thread Starter
Hyperactive Member
Re: Drag and Drop
 Originally Posted by Lightning
What happens when you debug?
It steps right over it.
I got the answer, you need to read a filestream. i'll post my code later for other users.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|