From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Use String Control as the Label in LabVIEW

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

This example shows how you can use string controls themselves as a means for creating labels.

 

Description

When you have limited space, but still want to have a label on your controls, it can be frustrating.


This VI is set up so that when you click on the string control, the label goes away and is replaced with an empty string. If there is no text entered into the control and the user clicks somewhere else, the label is put back into the string control.

 

Requirements
LabVIEW Base Development System.

 

Steps to Implement or Execute Code
1. Open the attached VI "Text Label in Control LV 2012 - NI Verified.vi".
2. Run the VI.
3. Click on any control to change the text value.
4. Click on any place in the pane to return the label text to the controls that are empty.

 

Additional Information or References

 Snippet 12092.png

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

National Instruments
Applications Engineer

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