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


Reply With Quote
