Track and Obtain Cursor Position Within String Input Field

Updated Jul 15, 2025

Environment

Software

  • LabVIEW

This article explains the method to implement Selection:Start property along with Key Focus to track and obtain cursor position within string input field.

By doing this implementation, it can resolve below issue:
In a string controller, when multiple characters are input and the arrow keys are used to move the cursor, is it possible to obtain the position of the cursor?

Based on below LabVIEW snippet:

  1. Create Text Reference hence wire to the Property Node.
  2. Pull down and select Selection:Start property and Key Focus property from Property Node.
  3. Set Key Focus property to True and create Indicator for Selection:Start property.

 
Note:
This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project.
To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block.

Upon running the LabVIEW code, based on below screenshots,
when the cursor is as the frontmost of the string input, the Selection:Start property indicator will show 0 indicating the cursor is at the first element position.
 

When the cursor is moved two steps right of the string input, the Selection:Start property indicator will show 2 indicating the cursor is at the third element position.