Try this:
- Create a new VI with a numeric control on the FP and an event structure on the BD
- Add an event case for "ValueChange" on the numeric control
- Run the VI and click inside the numeric control
- Press "Return" (or "Enter")
Notice that this does *not* trigger the value change event. However, editing the value and then pressing enter triggers the ValueChange event.
Ahh, but you point out "Well, in that case, the value *did* actually change, so that's why the event fired." And you're right.
But then try this:
- Change the value to some arbitrary number, say "1234"
- Observe that the ValueChange event fires
- Now, highlight the numeric text and retype the exact same value: "1234", then press enter
- Behold! This time it triggers a ValueChange event
Seems super minor, I know. But I found myself in a situation where I want to trigger an event if a user hits "enter" in a numeric field, regardless of whether the value changed or not (e.g. it should be able to reassert the current value). Yes, the obvious solution is to handle the enter key press separately, but that means when the enter is used to assert a different value, I end up with *two* events.
Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.