LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse down event reading a string terminal trick

Hi,

 

I wondered why I was getting frustrated entering a pasword that was verified in the mouse down event of the OK button. This is becuase when you click the OK button the entered text is still in the buffer and not copied to the terminal. (Which is more natural than clicking somewhere on the FP first). Note pressing enter or tab gets the string control out of enter text mode.

 

Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event. As this is one of those not obvious but sometimes happens bugs... I have posted for reference for others 🙂

 

Example attached v8.6.1.

 

 

0 Kudos
Message 1 of 4
(3,093 Views)

Nick wrote:

 

Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event.


AFAIK, "Update value while typing" will trigger only a Value Change event of the Str Ctl.

 

Mouse Down event will preceed a Value Change event, if you have both the event cases configured in your code.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 4
(3,080 Views)

Hi Nick,

 

You could set a boolean "PwCorrect" in an event case triggering on the value change event on the password string control. You could also use the mouse up event on the OK button (this would also mimic the behaviour in most applications better) and deal with stopping or not stopping the loop there as well.

 

//Martin



CLA
www.dvel.se
0 Kudos
Message 3 of 4
(3,064 Views)
I like your idea Martin. Cheers.
0 Kudos
Message 4 of 4
(3,035 Views)