Example Code

Drag and Drop with multicolumn Listbox

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
The example demonstrates using the “Drag Starting?”, “Drag Enter” And “Drop” events to customize the default drag/drop behavior.


Description

LabVIEW’s default drag/drop behavior only requires that dragging and dropping be enabled at the source and destination controls, and that the datatype of the source and destination be simple and match. This VI applies a custom name (Info) to the dragged data in the My Listbox “Drag Starting?” event and then uses that name to decide whether or not the Data indicator will accept the drop in its “Drag Enter” and “Drop” events. This technique is important to remember when you have multiple drag sources and destinations with similar datatypes. For more information see the “Implementing Custom Drag-and-Drop Behavior” topic in LabVIEW Help.

 

Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run the program. 
  2. Try to drag or drop the elements in Listbox .

 

Additional Information or References
VI Block Diagram

 
1.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 



Ing. Jonathan E. Cruz Ortiz

ENERGÍA PROACTIVA S.A.S

Cel : (+57) 3173669343 - (+57) 3124451894

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.