|
-
Oct 3rd, 2002, 10:54 AM
#1
Thread Starter
New Member
How to do it?
hey all
I need yours help regarding about oledragdrop. I have 1 sstab with 1 tab. The tab got 1 listview. My question is that how to drag the item from listview(within sstab) into a new form that contain listview?
Very much appreciate for the help.
-
Oct 3rd, 2002, 02:13 PM
#2
PowerPoster
Here is a quik "how to":
Form1: LIstview1, ImageList1
Form2: Listview1
VB Code:
'Form1
Option Explicit
Public ITM As ListItem
Private Sub Form_Load()
Dim i%
For i = 1 To 10
ListView1.ListItems.Add i, "K" & i, "New Item " & i, "file"
Next i
Form2.Show
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Set ITM = ListView1.ListItems(ListView1.SelectedItem.Index)
End Sub
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
ListView1.OLEDrag
End Sub
'Form2
Private Sub ListView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
'=============================================
Dim i%, k$, t$, ic
i = ListView1.ListItems.Count + 1
With Form1.ITM
k = .Key
t = .Text
ic = .Icon
End With
ListView1.Icons = Form1.ImageList1
ListView1.ListItems.Add i, k, t, ic
End Sub
Note: code above will "take" item from Listview1 on the Form1 to Form2
-
Oct 5th, 2002, 08:28 AM
#3
Thread Starter
New Member
Please help me, gurus!
hey IROY55
Thanks for your post. Unfortunately I still unable drag the item to the form2 by using your codes.
Anyone know how to do it?
-
Oct 5th, 2002, 10:29 AM
#4
PowerPoster
Check OleDragMode and OleDropMode properties for each control and change them if necessary. I believe it has to be Manual. Otherwise code should work.
-
Oct 7th, 2002, 12:48 AM
#5
Thread Starter
New Member
Please help
Yes, i am sure the oledrag/drop mode set to manual but i failed dragging the item from listview1(form1) into listview2(form2). The dragged item seem only able move inside the listview1.
please help
-
Oct 7th, 2002, 01:34 AM
#6
So Unbanned
1) read the top post on this forum.
2) avoid subjects like "how to do it", ask something relative to your question.
-
Oct 7th, 2002, 02:07 AM
#7
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
|