Implementing Custom Drag-and-Drop Behavior
- Updated2025-08-15
- 2 minute(s) read
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.
Complete the following steps to implement custom drag-and-drop behavior:
- Identify which controls to use as the drag source and drop target.
- Prepare the VI to detect when the user causes drag-and-drop events to occur.
- Detect when the user aborts a drag-and-drop operation.
- Start the drag-and-drop operation by providing the drag data.
- Verify that the drop target can accept the drag data.
- Update the drop target with the drag data.
- Determine when to stop the VI.
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.
Related Information
- Configuring Run-Time Drag-and-Drop Behavior for Text-Based Controls
- Choosing How the Event Structure Monitors For Events
- Creating Properties and Methods
- Step 1: Identify Which Controls to Use as the Drag Source and Drop Target
- Step 2: Prepare the VI to Detect When the User Causes Drag-and-Drop Events to Occur
- Step 3: Detect When the User Aborts a Drag-and-Drop Operation
- Step 4: Start the Drag-and-Drop Operation by Providing the Drag Data
- Step 5: Verify that the Drop Target Can Accept the Drag Data
- Step 6: Update the Drop Target with the Drag Data
- Handling a Latched Stop Boolean Control in an Event Structure
- Handling Errors