Programmatically Select String or Numeric Data in Control

Updated Oct 26, 2020

Environment

Software

  • LabVIEW

I want to programmatically select the string data inside a string control, as if I manually highlighted the string text inside the control.

 

You can do so by using the String Control Property Node, and setting the following properties. 
  • Write "True" for the "Key Focus" property
  • Write "0" for the "Text: Selection: Start" property
  • Obtain and input the string length for the "Text: Selection: End" 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 diagram.

Additional Information

For a numeric control, you only need to set the "Key Focus" property to "True".
 

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 diagram.