|
-
Mar 20th, 2000, 03:43 PM
#1
Thread Starter
Addicted Member
Hi,
Could someone please show me how to drag and drop a file into a ListView Control.
Thanks
-
Mar 20th, 2000, 07:57 PM
#2
transcendental analytic
Funny! I just didn't have to modify anything in the code. Here you go:
set the listbox props:
oledragmode=1
oledropmode=1
and the code:
--------------------------------------
Private Sub Lista_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If data.GetFormat(15) Then
For n = 1 To data.Files.Count
lista.AddItem data.Files(n)
Next n
Else
End If
End Sub
--------------------------------------
Hope this will help.
After edit: Oh no! I knew it. There was something I just had to modify.
[Edited by kedaman on 03-21-2000 at 08:00 AM]
-
Mar 20th, 2000, 08:01 PM
#3
Frenzied Member
kedaman that code is for a list box NOT a list view!
-
Mar 20th, 2000, 08:10 PM
#4
Frenzied Member
Code:
Private Sub ListView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim itmX As ListItem
Dim i As Integer
If Data.GetFormat(15) Then
For i = 1 To Data.Files.Count
Set itmX = ListView1.ListItems.Add(, , Data.Files(i))
Next i
End If
End Sub
setting the correct icon is a bit trickier though!
I'll have to have a think about that one
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
|