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.
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.
03-01-2019 01:29 PM
Hi all,
just as I thought I've seen it all, this happens.
I built a user interface with some setup information as well as a button to connect/disconnect.
After that the user can enter command in a line. The line is a system string control set up for single line and also update while typing to trigger a value change event.
Here's my problem: When I hit enter, the keyboard focuses on the Connect/Disconnect button and disconnects my application.
What I've tried:
The behavior I want is:
Enter text in string, press enter --> trigger string value change event
not focus on and press connect/disconnect button
ideally, keep focus on string, so the next command can be entered.
VI is attached it's written in 2012.0 f1.
I am grateful for all pointers and moral support in these trying times...
Solved! Go to Solution.
03-01-2019 01:36 PM
Sounds like your button is bound to <Return>. Right-click on the control, select Properties, go to the Key Navigation tab, and remove the binding.
03-01-2019 01:47 PM
@Mancho00 wrote:
Sounds like your button is bound to <Return>. Right-click on the control, select Properties, go to the Key Navigation tab, and remove the binding.
And also consider using a property node >>> FocusKeyBind to ...
When you get a "Command Key down" event and the character is NOT a Enter, set the FocusKeyBind for the command control.
When the key is an enter set the FocusKeyBind to the Boolean.
Ben
03-01-2019 02:14 PM
Oh for crying out loud! It was right there...
Thank you for your quick response!
I removed the key binding and on enter, I set the KeyFocus to true.
03-01-2019 02:43 PM
@PeterFoerster wrote:
Oh for crying out loud! It was right there...
Thank you for your quick response!
I removed the key binding and on enter, I set the KeyFocus to true.
It happens to all of us.
See here for an example of when I was brain dead.
Ben