LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable keys in a text box

Hi, I need a text box where only some characters are written, for example if the character "m" is forbidden, when I push the 'm' button there should be no effect. I tried with the event EVENT_KEYPRESS, but I didn't find any function to avoid the writing of the character in the text box.
0 Kudos
Message 1 of 4
(3,233 Views)
Massimiliano,

You accomplish this by "swallowing" the keypress event, which is to say, by returning 1 from the callback function.

Luis
NI
0 Kudos
Message 2 of 4
(3,233 Views)
Here's a small CVI sample program which does what you want.

Regards,
Heinrich Illig
NI
0 Kudos
Message 3 of 4
(3,233 Views)
Thank you very much !! Your advices solved my problem.
0 Kudos
Message 4 of 4
(3,233 Views)