Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Quick Way to Disable Copy-Paste in a Textbox in a WinForms Application

Learn how to disable copy/paste, and other shortcuts, in newer versions of .NET.


advertisement

In the old versions of .NET, we needed to override the default context menu and override the ProcessCmdKeyfunction to return True to disable Copy-Paste of content into textboxes through keys such as Ctrl+C, Ctrl+V, Shift+Insert, etc.

In the newer versions of .NET, we can just disable the "ShortcutsEnabled" property to False. This will do the trick. You can no longer copy/paste or perform any other actions through shortcuts on the textbox.

 



Visit the DevX Tip Bank

 



   
Srinath M. S. says: "I would love to leave a footprint in this flat world."
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date