LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

prevent pasting to a control

Invoke node App.Clipboard.Read will let you look at what is in the clip board and then you decide if you will canel the clrt key or not.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 13
(785 Views)

Excellent!  With some of the above suggestions, I have been able to get the control to behave the way that I want.  I do the following:

1.  On a Menu Selection? (App) event, if ItemTag=APP_PASTE, discard the event if the clipboard text is not acceptable.  The clipboard text is found using an invoke node as suggested elsewhere in this thread.

2. On a Shortcut Menu Activation? event, discard the event if the clipboard text is not acceptable.  A menu item of a default shortcut menu can't be discarded, so a custom shortcut menu had to be made.  I haven't completely implemented the custom menu yet, but I expect it to work.

3. Unacceptable single key presses are prevented using Key Down? and Key Repeat? events and discarding the events if the key presses are unacceptable.

 

Thanks for all the help with this.

Message 12 of 13
(757 Views)

Thanks for the summary and follow-up. This should help others witht esame Q in the future.

Here have some stars!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 13
(751 Views)