|
-
Dec 15th, 1999, 02:46 AM
#1
Thread Starter
Lively Member
Hi everybody!!!
Does anybody know how can i made drag & drop with list view? I have problems to select an item while begin the drag function.
Thanks in advance!!!
I appreciate your help.
------------------
Angel Maldonado López.
Programmer
[email protected]
-
Dec 15th, 1999, 03:36 AM
#2
Add a Listbox and ListView Control to a Form, then Paste this quick Example I have put together..
Code:
Private Sub Form_Load()
Dim I As Integer
ListView1.View = lvwList
ListView1.MultiSelect = True
ListView1.DragIcon = LoadPicture("..\Common\Graphics\Icons\DragDrop\Drag3pg.ico")
For I = 1 To 100
ListView1.ListItems.Add , , "Item " & I
Next
End Sub
Private Sub List1_DragDrop(Source As Control, x As Single, y As Single)
Dim I As Integer
If TypeName(Source) <> "ListView" Then Exit Sub
With Source
For I = 1 To .ListItems.Count
If .ListItems(I).Selected Then List1.AddItem .ListItems(I)
Next
End With
End Sub
Private Sub ListView1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
ListView1.Drag vbBeginDrag
Else
ListView1.Drag vbEndDrag
End If
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Dec 15th, 1999, 04:02 AM
#3
Thread Starter
Lively Member
Yeah!!!
It works perfect...
Thank you very much Aaron, you have saved my program...
Thanks again...
------------------
Angel Maldonado López.
Programmer
[email protected]
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
|