Example Code

Drag and Drop Controls and Indicators on Front Panel

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 how to programmatically move Front Panel elements at run-time with drag and drop mouse gestures.

 

Description

The VI registers mouse up and down events on the 'movable gauge'. Whenever there is a mouse down event the coordinates of the mouse click location are saved in a shift register. As a next step a mouse up event either on the gauge itself or the front panel pane will trigger the calculation where to move the gauge. With the position property the location of the gauge will be manipulated.

 

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI
  3. Click on the Movable Gauge and release the mouse button where you want to move the Gauge to

 

Additional Information or References

Move Front Panel Elements at Run-Time - Front Panel.png

 

Move Front Panel Elements at Run-Time - Block Diagram.png

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Bryan H.

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting.  The image is broken and the file name doesnt include the LabVIEW version.  Please edit this ASAP.

Todd S.
LabVIEW Community Manager
National Instruments
joshuatree
Member
Member
on

can u post as 8.5 or earlier?  pretty please..

Hesloppy
NI Employee (retired)
on

I posted a copy in LabVIEW 8.0.

Bryan H.