Example Code

Count the Number of Characters in a Control while Typing Using 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 VI counts the number of characters you’ve typed.

 
Description

To count the number of characters in a control, the user can either press Enter or click on a different area of the front panel.  If you want to count the characters in the control as you typing but without pressing Enter, right-click on the control and select the "Update Value While Typing".


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open and run the VI.
  2. Type some characters in the string control, and press enter to see its length.
  3. Right-click on the control and select the "Update Value While Typing" to count length while typing.

 

Additional Information or References
VI Snippet

005.png

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

Regards,

Sara Lewandroski
Applications Engineer | National Instruments

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

Comments
shb
Active Participant
Active Participant
on

The Property Update Value While Typing also changes the behavior of the control. It is not possible anymore to cancel changing the value by pressing escape. If this is not desired, use the key down event and read the Property Text.Text to get the current shown text.