Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ring ZhongRank #6,843 · 255 reputationPosted Dec 1, 2013, 10:13 PM EST
Select the textbox in the designer, and in the property grid, set "ReadOnly" to True. This will disallow any typing/pasting into the control, and will grey out the appropriate entires from the context menu.
If, for some reason, you still want the user to type into the textbox (but just not paste into it) and want the cut/copy/paste entries in the menu to go away completely, you need to set "ShortcutsEnabled" to False for the textbox control, and provide your own ContextMenuStrip (which you can drag over from the toolbox into the form designer), selecting it in the "ContextMenuStrip" value in the property grid for the TextBox control -- that will override the default context menu.
referral: http://social.msdn.microsoft.com/Forums/en-US/1bf46245-4696-44f0-ab36-5fb51cb546cd/disable-copypaste-in-textbox
Hope this helps,
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 1, 2013, 10:37 PM EST
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Dec 1, 2013, 10:40 PM EST
http://www.dotnet-tricks.com/Tutorial/jquery/D9UO110612-Disable-cut,-copy-and-paste-in-textbox-using-jquery,-javascript.html
Sanjay KumarRank #561 · 4.3K reputationPosted Dec 1, 2013, 11:45 PM EST
http://www.aspsnippets.com/Articles/jQuery-Disable-Cut-Copy-Paste-and-Drop-options-in-HTML-and-ASPNet-TextBox.aspx