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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One click to overwrite a control

With a double click you can overwrite a numeric or string control, but does someone knows how to overwrite a control with one click? (one click normally puts the cursor at the end of the input field)

Kind regards,
0 Kudos
Message 1 of 4
(2,376 Views)
You could probably do this with events and invoke nodes. You need to have a mouse-click event for the control. In that event, invoke a select all. I think that should do it. It should select the data in the control when you click on that control. I think that is what you are after.

I hope that this helps,
Bob Young
0 Kudos
Message 2 of 4
(2,376 Views)
The attached VI will do what you want, using events. It's a bit more complicated than just catching the mouse click event, as you presumably want to click a second time to set the insertion point.

The behavior is obtained by setting a boolean called Entered in the Mouse Enter event, but only if the control does not already have key focus. Then, in the Mouse Up event, if Entered is true, we select all text; if not, we do nothing, which result in setting the insertion point.

This seemed like a good idea, so I filed a suggestion to have LabVIEW add a configuration selection to controls to do this (so no programming would be required).

Enjoy,
Roy
Message 3 of 4
(2,376 Views)
Brilliant,

It doesn't work on a strict type def. but this was exactly what I needed.


Thanks,
0 Kudos
Message 4 of 4
(2,376 Views)