LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to change the sign of a numeric number by sending a specific keyboard code (like in Windows Calculator)

Hi everyone,
 
I actually developp a numeric keyboard emulation and I would like to emulate the behavior of the Windows calculator for the sign changed. I explain the purpose : I would like to change the sign of the numeric input when I stroke a own defined image button (+/-). Is there a another solution that to allocate dynamically a variable with the same type as the UIR numeric input and use the minus operator to change the sign...
 
Thank you for your answer,
 
Regards,
 
Jean-Noel Pomies
0 Kudos
Message 1 of 2
(2,678 Views)
Within the callback for the numeric control, you could trap the EVENT_KEYPRESS event and check that the key pressed was the one you have assigned the +/- operation to. It is then a simple matter to negate the value held in the control.
 
JR
0 Kudos
Message 2 of 2
(2,672 Views)