|
-
Dec 2nd, 1999, 09:26 PM
#1
Thread Starter
Addicted Member
I have a list box which contains several files and a picture of a Trash bin underneath.
I have written some code to Drag and Drop the files into a second list box. However, I also want to be able to drag the file below so that when it touches the Trash Bin Picture, the file is deleted.
How do I kill the file when it reaches the picture ?
-
Dec 2nd, 1999, 09:45 PM
#2
So Unbanned
i.e. Kill "c:\command.com"
------------------
DiGiTaIErRoR
-
Dec 2nd, 1999, 09:55 PM
#3
Try this. Change the DragIcon property of the Listbox to the appropriate picture.
Code:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag vbBeginDrag
End Sub
Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
On Error Resume Next
Kill List1.List(List1.ListIndex)
List1.RemoveItem List1.ListIndex
End Sub
Assuming that the Listbox has the files with the complete path (e.g. C:\MyFolder\MyFile.txt)
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 12-03-1999).]
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
|