LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Control porperty for selecting text

I am making a small program to use barcode scanner to input serial number and part number.  serial # and part # are both string controls. the barcode scanner scan the number and add a RETURN at the end of it.
 
Right now, after I scan serial number, I use "Key Focus" to move the cursor to part #. However, part # still has previous value. So the cursor will be at the end of previous value. If I scan the bar code now, the new value will append to the old value. I would really like the old text being highlight, so if I choose to keep the old value, I just hit enter, and if I choose to enter new value, the new number from scanner will overwrite the old text (since they were selected). So is there a porperty to make the key focus and select original text?
 
Thanks,
0 Kudos
Message 1 of 3
(3,424 Views)

There is a Text --> Selection property you can use to highlight the text in your string. See included VI.

Message Edited by JaredW on 03-02-2006 04:41 PM

Message 2 of 3
(3,418 Views)

Too bad the trick (set the Key Focus) doesn't work for string indicators.

 

Setting key focus on an indicator does work, FindCtrlWithKeyFocus reports the indicator, however the string select doesn't buy into it...

 

If the indicator has key focus, changing it will work. However, my use case is to copy selected text, and the menu removes key focus and the selection highlight (the selection is still there). There's no way to get the text highlight back.

0 Kudos
Message 3 of 3
(319 Views)