Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!
I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!
Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.
To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!
Waiting for your valuable reply ...
Regards,
Ruturaj.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!
I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!
Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.
To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!
Waiting for your valuable reply ...
Regards,
Ruturaj.
Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!
I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!
Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.
To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!
Waiting for your valuable reply ...
Regards,
Ruturaj.
Please Help Me With Drag-n-Drop Of Multiple Items From One Listview To Another.
Hello!
I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!
Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.
To help you all to get a better insight of my problem, I have attached a Demo of Listview Drag-n-Drop. Please see the project and you will see that when one item is dragged from left side Listview to right side Listview, no problem for VB to allow me to do it! However, when you select multiple items in left side Listview and try dragging those to right side Listview, only one item is dragged. Please let me know if I'm doing anything wrong here and please help me to get this stuff to work!
Waiting for your valuable reply ...
Regards,
Ruturaj.
Please Help Me With Drag-n-Drop Of Multiple Items
Hello!
I'm facing a problem with Listview Drog and Drop of multiple items from one listview to another listview. When I try to Drag only one single item, the item is dragged without any problem. However, when the multiple selected items are dragged, the Listview on which the items are dropped, receives information about only one item and not all selected items. The item, about which the information is received, is the same on which I click and hold mouse to start drag action. So, it looks like even though multiple items are selected in a listview, while executing the Drag-Drop action, listview treats it as single item selected!
Is this a default behavior of Listview or am I missing/doing anything wrong? Any work-around for this (seems like default) behavior of Listview? I searched for it and got a code example at http://btmtz.mvps.org/listview/ where the author has demonstrated Drag-Drop of multiple items. However, the code is specifically restricted to re-arranging items within same Listview and the information is transported via Drag-Drop to another Listview, upon which the items are dropped.
Waiting for your valuable reply ...
Regards,
Ruturaj.
Drag And Drop Items In A Listview
Is there an easy way to rearrange the order of the items in a listview with a drag-drop operation? I tried using the HitTest method and some drag/drop events but it is kinda clunky.
Drag-n-Drop List Box Items
Is this possible? I have a list box that contains 'items' that involve 4 pieces of data and I want to drag them from one list box to another. Is this possible? What settings do I have to use and how? Thanks!!!
How Can I Drag And Drop Items In Listboxes
ive got these two listboxes, and i want to be able to alter the position of items within one box by drag and drop, while the second listbox repositions its items simultaneously. how can i go about it?
Drag/drop Items In A List Box
I have a listbox with a list of names (order matters, but not sorted by alpha). How can I allow the user to drop/drag one name from its current location to another?
It would be nice to allow several names (must be adjacent in the list) to be moved.
Any thoughts?
Drag && Drop - Items Order
I have to make a form (into a whole app) that allow me to set the order of some records. For example, in a table I have a field that represents the order in which they should be shown. The form I'm being asked to do is one which allow me to set/modify this but with Drag&Drop. Which is the best control you think I should use?
Drag And Drop List Items
How do I drag and drop items from one listbox to another? I know that this should be obvious and automatic but resetting drag proprties doesnt seem to work-I can drag but not drop. Recent threads on this topic deal with more complex issues occurring after the event. I need to get started.
Thanks
Drag And Drop To Reorder Listbox Items??
All,
I am using VB6 with a standard listbox control. What I am trying to do is get drag and drop capability on the items within the list box so that users can re-order the items by dragging and dropping them to the new position.
I have found code on MSDN that works...sort of. It uses the DragDrop event that seems to set the DragMode to automatic in code. The drag and drop does work but it seems as an artifact of that, when I click and drag the item, rather than isolating to the selected item, the entire frame of the listbox becomes attached to the mouse cursor and is dragged as the mouse cursor is moved.
Additionally, it doesn't actually move the control, it just drags the frame with the mouse cursor, when the mouse button is released, the frame disappears and the item is rearranged in the list. I want to just have my defined cursor display, not the list box frame.
Anyone have any code or know how to easily rearrange list box items?
Thanks in advance,
-John
Drag And Drop Form Items. Sleight Of Hand!
Hi,
During runtime, I want to drag items from one field of a form to another.
I assume I must capture the click event of the object to be moved and then click to the object that will recieve the data and then behind the scenes just copy the info from and to.
eh?
However, I'd like a drag effect.
Say, a user clicks a number and then pictorially drags it to its new location.
I suppose I'd use BMP's.
Is it just a question of changing the shape of the cursor?
Or could I instead attach a BMP to the cursor and when the user decided where to place the data, discard the BMP and then copy the data behind the scenes?
TIA,
Bill
I suppose I'd use BMP's.
Is it just a question of changing the shape of the cursor?
Or could I instead attach a BMP to the cursor and when the user decided where to place the data, discard the BMP and then copy the data behind the scenes?
TIA,
Bill
How To Drag Drop Tree View Items Using Ini Files
hi all,
[give me some code relevent help]
i am using "ini" file to populate my tree view with sections of ini files and facing problem in draging an item from tree view and drop it in other section, so in this case the position of that item in tree view is changed and it is visible in as node in other section.
below is the example of tree view, if i drag "phone#" from company and drop it below the designation then it should be deleted from company section and should be added in employee section graphically.
Root node
...company
............name
............address
............phone #
...employee
............name
............sex
............designation
How To Drag Drop Tree View Items Using Ini Files
hi all,
[give me some code relevent help]
i am using "ini" file to populate my tree view with sections of ini files and facing problem in draging an item from tree view and drop it in other section, so in this case the position of that item in tree view is changed and it is visible in as node in other section.
below is the example of tree view, if i drag "phone#" from company and drop it below the designation then it should be deleted from company section and should be added in employee section graphically.
Root node
...company
............name
............address
............phone #
...employee
............name
............sex
............designation
Drag And Drop Multiple Objects
I am trying to write some code that selects a number of image boxes and drags them all together to be dropped to another portion of the form. I have set drag mode to manual and tried to start the drag in the following way...
For i = 0 To UBound(selected)
Imageshadow(get_index(selected(i))).Drag vbBeginDrag
Next i
However, this seems to only initiate the drag on the last of the arrays cycled through. Does anyone know how to do this properly? Or know of a tutorial where this is done?
Drag Drop && Multiple Arrays
I have exhausted all resources on this project! I have a form with 6 computer images that need to "drag drop" to 5 picture boxes and change the image. When I try to do this the source array seems to be linked to the "good drop source" array and shows all pictures with the same Index as the source. How do I make the drop result just one image?
Drag And Drop Multiple Controls
I have a bunch of image controls on a form. My app allows a user to select one or more image boxes and then drag them onto some other control at the top of the screen.
How do i get the drag icon for multiple controls to all drag at the same time?
Right now one controls get the drag icon, when it is dropped i just take a peek at what the user highlighted, the issue is that users want to see a drag icon for each image
Listview Drag And Drop
Hi,
i have a listview set up as a listing of files.
I have the drop function up and running so the user can drop files straight into the list but what i can get working is the drop function.
All i want to be able to do is have the user drag the selected items from the list outside the form and return the address of where the files are to be dropped as a message box.
If anyone can help or point me in the right direction it would be great,
-Dave
Listview Drag && Drop
Hello,
Can someone please point me in the direction of an example of using drag & drop within listview. I've been searching the web and keep coming up empty handed!
What I'm trying to do is something like Winamp does in it's playlist for example. I would like to be able to drag a full row of data and drop it in another row.
Thank you!
Listview Drag N Drop
Hi anyone have any ideas how to create a drag N drop between two listviews? I keep coming up with an error with this code, the line that is red is where the error comes up:
Private Sub lstview1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim c As Long
Set lstview1.SelectedItem = lstview1.HitTest(X, Y)
c = lstview1.SelectedItem.Index
lstview1.DragIcon = images.ItemIndex(3)
lstview1.Drag vbBeginDrag
End Sub
Private Sub lstview2_DragDrop(Source As Control, X As Single, Y As Single)
Dim LI2 As ListItem, LI3 As ListItem, i As Byte
Set LI3 = lstview2.HitTest(X, Y)
If LI3 Is Nothing = False Then
Set LI2 = lstview2.ListItems.Add(LI3.Index + IIf(LI3.Index < Source.SelectedItem.Index, 0, 1), , Source.SelectedItem.Text)
Else
Set LI2 = lstview2.ListItems.Add(, , Source.SelectedItem.Text)
End If
For i = 1 To lstview2.ColumnHeaders.Count - 1
LI2.SubItems(i) = lstview2.SelectedItem.SubItems(i)
Next i
lstview2.ListItems.Remove lstview1.SelectedItem.Index
LI2.Selected = True
End Sub
Drag && Drop In Listview
Hi Everone!
I would like to know, how I can drag & drop rows IN a listview.
I've seen some examples for a listbox, but not for a listview...
Thanks a lot!
Greetz Kevin,
ListView Drag 'n Drop
I have most of the functionality for dragging and item from a listview and setting the text in a textbox to that data. However, when I drag the the item I get a drag icon that to the user code be interpreted as dragging the whole list. Basically, instead of a small rectangle I'm getting a big one. How would I go about fixing it?
Code:
Dim strHolder As String
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Not (ListView1.HitTest(X, Y) Is Nothing) Then
ListView1.HitTest(X, Y).Selected = True
strHolder = ListView1.SelectedItem.Text
ListView1.Drag
End If
End Sub
Private Sub Text1_DragDrop(Source As Control, X As Single, Y As Single)
If TypeOf Source Is ListView Then
Text1.Text = strHolder
End If
End Sub
Private Sub Text1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
If TypeOf Source Is ListView Then
If State = 0 Then Text1.BackColor = &HFFFFC0
If State = 1 Then Text1.BackColor = &HFFFFFF
End If
End Sub
Help With Listview Drag And Drop
I have a listview with folders on top with files listed after them. I want the user to be able to drag and drop a file into a folder. I know this can be done with drag and drop, however is there a way to auto scroll up or down when the user drags the file that way.
Thanks
Help With Drag/drop From Listview
I have a ListView control and a number of text boxes.
When I try and drag/drop from the listview to a text box or list box
I get the error 438
'Object doesn't support this property or method'
can any one help ??
Drag And Drop On ListView
Is there a way to use a drag and drop operation on a listview control itself. For example if I wanted to move a file on a listview control to a folder in the same listview control. Can this be done?
Thanks
Listview Drag Drop
How do you drag a row in a list view box an drop it to another part of the list view so that the row is inserted between the two rows where the drop occurs.
Listview Drag And Drop
Does anyone know how I can drag and drop multiple values from one listview to another. Using the listview_OLEDragDrop event I can transfer 1 value, but it doesn't work if my source listview allows multiselect.
Listview Drag And Drop
Hello there,
I have a listview with 3 columns.
I Want to drag the 3 colums to a textbox.
I use the statement CentralMemoListFrm.liMemo.SelectedItem = CentralMemoListFrm.liMemo.HitTest(X, Y) to determine which row us selected.
But this statement selects the text of the first column instead of the third.
Does anybody know how to select the text of the 3 column of the row selected?
Many thankx!!!
Drag+drop Listview
How can I drag at list view item (it should show the icon I specify when it is being dragged) into a richtextbox, then have text go in the rich text box where I drag the listview item to?
Drag And Drop Within Listview
Hi,
I've been using VB6 for a while now, and I've created a couple of programs from it. I've recently started using OLE Drag and Drop to be able to do several things, and all seems well when "copying" an item within the same listview. However, I can't work out how to "move" an item within the same listview. I am able to code it to the point whereby it can detect whether I want to move or copy the item, and whilst I know what to do to copy an item, I do not know how to move an item within a list view.
I hope this makes sense, and if anyone has the answer (which is probably pretty easy), it would be much appriciated.
Tim.
Drag N Drop With ListView
I would like to drag an item from one list to another
I could use a sample and some property settings
Thanks in advance
Thom Boglino
CLC Education
Thom Boglino :)
The Computer Learning Center
727-847-6955
352-683-7255
email@removed
email@removed
*Copyright (c) confidential message. No redistribution.
This message is intended for the use of the addressee
only and may contain confidential or privileged information.
If you have received it in error please notify the sender
and destroy it. You may not use it or copy it to anyone else.
How To Drag And Drop In Listview?
Hi guys,
I'm using VB.NET.
I have a simple application. Just a form, and a ListView.
I have a procedure in the form, it read's all the files in my specificed local drive, and show the files name, size and created day. It works perfectly.
Now, I want add a drag and drop functionality in this application. For example, when I drag a file from my desktop, and drop it in the list box, it will do the following:
- Add the file's name, size and date into the listview
- Copy the file to my another specificed path
My problem is simple, I don't know how to do it! :)
Can anyone give me a sample code and let me figure it out, or give me some hints, advice or anything can help.
Thanks in advance :)
Andy
Drag Drop With A Listview
i have a listview that has to colums. i want to be able to drag an item and drop the information (from the 2 columns) to another part of the form, like a label.
can anyone help me with this????
gkc
Drag And Drop In ListView
Hi,
I am trying to drag and drop multiple items from a listview on to a treeview node which will ultimately be updated in a corresponding table in the database(just like selecting multiple files in windows explorer and copying to different nodes).My problem is I am not able to drag all the items that I select.When I drag only one Item gets selected,Could somebody help me with this problem or give me some suggestions.Any suggestions will be highly appreciated.
Thanks in Advance
Cheers,
Suvipra
Drag && Drop Multiple List Entries
When a listbox's Multiselect property is set to Extended how do you drag multiple items? If you start moving with the mouse button down, you just select more entries.
Drag And Drop Multiple Controls Runtime
I want to drag and drop multiple textboxes at runtime to a frame which is placed on form.
i am move drag or drop only one control at a time. but i want that multiple controls has to drag and drop at a time.
Thanks in advance.
Ramkishore
Drag And Drop Of Multiple Selected Controls
Hello,
I am building a HTML editor and therefor I want to add (runtime) drag and drop facilities within the editor. The problem is how to drag and drop multiple controls in one single drag action. Should I call the method vbBeginDrag of all selected controls?
I would appriciate if someone can help me on this one...
Thanx in advance!!!!!!!,
Raymond
Drag And Drop From Listview Onto Listbox
I need to be able to perform a drag'n'drop from a listview in report-view mode onto a listbox.
I can get the first item (I want to multiple select too) that is dropped, however I cannot do the following:
1) I want multiple, performing a For Each vfn In Data.GetData(1) doesn't work, I get can the first item by msgbox data.getdata(1)
2) The destination listbox, how can I tell what item in the listbox that the dragged objects have landed on.
Cheers!
Carl.
Listview Drag Drop To Folder
I have 2 listviews. One is a list of folders and the other is a list of files. I want to be able to drag selected files to a folder in my list of folders.
Thanks
Drag&&Drop And Multiselect In Listview
Hi,
i have a litle problem.
I have activate multiselect on my listview.
But the multiselect doesen't works. I know why.
I have the MouseDown option for the drag&drop:
Code:
Private Sub PN_ChartVersionList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = vbAltMask Then
Set PN_ChartVersionList.SelectedItem = PN_ChartVersionList.HitTest(X, Y)
If Not PN_ChartVersionList.SelectedItem Is Nothing Then
PN_ChartVersionList.Drag vbBeginDrag
End If
End If
'PN_ChartVersionList.SelectedItem = Nothing
End Sub
yet i must let held down the alt key to drag and drop because otherwise the mutliselect doesen't works.
How can I resolv this problem, that i can drag&drop or multiselect the items without press any keys exept for the multiselect the (ctrl + shift) key.
sry for my english :/
Treeview/Listview Drag And Drop
Hello.
I have 2 questions about dragging into a listview:
1)
Where can I get the code for dragging a specific node from a treeview, into a listview (I just need to add the value of the dragged node as a new record in the listview).
2)
I also look for the code for dragging a file from the desktop into a listview. There are lots of exmaples on the internet for doing this, but I need to drag a file into a listview control (and not any other control).
Thanks,
Edi.
P.S.
I use VB6 and not .NET
Drag And Drop Into Listview Crashes VB
Hi,
I have two multiselect listviews in which I have OLEDrag methods/events handling drag/drop of listitems between them. If I select all of the listitems from one listview, drag and drop into another, it will *usually* cause the VB IDE to crash with a general protection fault! I've tried everything to track this one down and now I'm at my wit's end.
The problem relates only to the OLE drag/drop since I can move the same listitems via a command button (click) procedure call and it works reliably every time.
I cannot be the only one who has experienced this, so if any one has seen this sort of behavior before, please contact me! I'm running VB6 SP6, with latest mscomctl.ocx (6.1.97.86)
Much thanks,
PJ
|