LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

listbox drag multiple items out

Solved!
Go to solution

Want to drag multiple items out of a listbox.  Is this possible?

George Zou
0 Kudos
Message 1 of 5
(3,171 Views)

zou wrote:

Want to drag multiple items out of a listbox.  Is this possible?


Whereto?

 

In the same VI?

 

Register for the 'drop' event on a control, the drag and drop data will have info, here's a sample VI. make sure you allow dragging from the Listbox.

 

ListboxDrop.png

 

The help is very specific on the actual data type in the info. However it's hard to understand:

LV_LISTBOX_ITEMS Array of a cluster that contains an array of strings in the item you are dragging (in order from left to right) and an integer that represents the glyph index associated with the item from which you are dragging data.

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 5
(3,159 Views)

To a tree control in the VI.  I don't want to handle the tree drop event because tree control takes care of it.

 

Thanks for reply.

 

George Zou
0 Kudos
Message 3 of 5
(3,131 Views)

Hi George,

 

Dragging multiple items from a listbox is a matter of using the right settings for the listbox as shown in the image.  Dragging from one listbox to another works just fine with these settings.

 

 

 

However, when dragging this to a tree control, it will only copy the first item.  Therefore, you probably will need to use events as Ton mentioned.

Message Edited by jareds on 04-26-2010 08:12 PM
Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(3,114 Views)
Solution
Accepted by topic author zou

Jared,

 

Thanks for reply.

I should mentioned that all those settings you pointed out have been set before I posted here.

Just like you mentioned it doesn't work if the target is a tree control.

 

This isn't my design.  I just put on a finish touch.  This tree control has complicated roles.  I definitely don't want to handle the drop event.

 

I found a work around:

In the listbox drag end event, find the drop position, and programmetically add multiple items. Smiley Happy

 

George Zou
Message 5 of 5
(3,092 Views)