05-08-2013 12:15 PM
Hello! I am back to doing some LabVIEW programming and ran into a problem that I cannot seem to solve.
I am trying to use dag and drop on a listbox. I have it set to move only and it works fine. The problem is that if I have a drop event the item moved just goes away. I could not find any examples or answers in the forums.
Anyone care to teach me about drag and drop?
Thanks
Solved! Go to Solution.
05-08-2013 12:47 PM
If you right click the listbox to access the properties you will find under drag and drop >> drag mode you have it set for move only.
If the item is going to be "moved" then it will be deleted from the list when the drag operation is completed -- this is probably what you want.
However you have to manually add the item back into the list if you accept the drag operation. You can find a decent example here:
05-09-2013 04:44 PM
Thanks. The listbox behaves just like I want it to unless I add the drop event. I will have to figure out how to insert the items to the dropped position. It really isn't straightforward is it.
05-09-2013 06:03 PM
It is not unstraightforward. Shift register holds the listbox value at the time of drag start (ie. the index of the item).
02-14-2014 09:30 AM
Let me start off by saying that it is really, really dumb that just adding an event case should cause the behaviour of a control to change so drastically. Having gotten that out of my system, the examples I have found using the get drag drop data vi only seem to work with single items. If I'm trying to drop multiple items (i.e. I can select multiple items in one listbox to drop in another) I can't seem to make it work. I tried using the LV_LISTBOX_ITEMS entry to the vi, but even with a probe on it, I can't discover what it is trying to return. How can I drag and drop multiple items at once?
02-17-2014 04:10 PM
Hey rossu,
I believe that I have found something that may help. The link below explains how to select multiple items at once.
http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/setting_the_number_of_sele/
Also, it may help to repost this issue in a new forum since this one has been inactive for a while.
Hope this helped.
02-20-2014 08:01 AM
Actually, the issue is not multiple selections but dropping multiple selections. I will repost this as you suggest along with my current solution