Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Implementing Custom Drag-and-Drop Behavior

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Although LabVIEW provides built-in drag-and-drop behavior for text-based controls, you can programmatically implement custom drag-and-drop behavior for any controls, including non-text-based controls. Programmatically implement drag-and-drop behavior with drag-and-drop events to accomplish the following tasks:

  • Allow users to drag and drop data between non-text-based controls.
  • Provide custom drag-and-drop behavior for text-based controls.
Note Note  These topics assume familiarity with Event structures, properties, and methods.

Complete the following steps to implement custom drag-and-drop behavior:

  1. Identify which controls to use as the drag source and drop target.
  2. Prepare the VI to detect when the user causes drag-and-drop events to occur.
  3. Detect when the user aborts a drag-and-drop operation.
  4. Start the drag-and-drop operation by providing the drag data.
  5. Verify that the drop target can accept the drag data.
  6. Update the drop target with the drag data.
  7. Determine when to stop the VI.
Note Note  Error handling practices are omitted from the block diagrams in these topics to improve the clarity of the block diagram and to focus on the steps necessary for implementing custom drag-and-drop behavior. Provide error handling mechanisms to tell you why and where errors occur.

Additional Examples

Refer to the Drag and Drop - Passing Custom Drag Data VI in the labview\examples\Structures\Event Structure directory for an example of using drag-and-drop events to implement drag-and-drop behavior.

Refer to the Drag and Drop - Initiating a Custom Drag VI in the labview\examples\Structures\Event Structure directory for an example of implementing drag-and-drop behavior on the plots of graphs.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit