Showing results for 
Search instead for 
Did you mean: 

How to drag and drop from MS TreeView Control in LabVIEW

Does anyone have an example of dragging an item from an MS TreeView Active X control in LabVIEW, and dropping it onto a native LabVIEW control such as a string indicator or a waveform graph?

I am using a treeview control to display a list of items. I want the user to be able to drag and drop any of the items onto a waveform graph - and then respond with some code that loads appropriate data on the graph.

0 Kudos
Message 1 of 4


 treeview information is text, so dragging and dropping from a treeview control to a waveform graoh isn't that sensibleand directly, we only allow dragging and dropping with within listboxes, tree controls, strings, and paths at run time.

For a string therefore, that can work.

Right click the treeview control, and select TreeView>>Properties, then set the Dragging mode to Automatic.

Right click the string, and make sure that the Advanced»Allow Drop is checked.

That will then enable the dragging capability from the Microsoft tree control to the string

The drop event is only monitored between LabVIEW items, so a workaround for the graph of placing an invisible (coloured transparent, not actually non-visible) string control over the top of the waveform graph to capture the new text placed into it to from the Microsoft tree control to catch for that drop event wouldn't be possible.

If you were to work with the native LabVIEW ones however, then that could be directly captured by the waveform graph Drop filter event, and then you would have to work out which item was dragged (with a drag starting event from the LabVIEW tree control to capture which data was being dragged).

Hope that helps.


Sacha Emery National Instruments (UK)


Message Edited by SachaE on 08-07-200601:05 PM

Message Edited by SachaE on 08-07-2006 01:08 PM

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 4

Ooops - forgot the example code.

Hope that helps

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 3 of 4
That is very helpful - I think I will be able to sort out a solution from this.
Many thanks
0 Kudos
Message 4 of 4