Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2007, 02:15 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default disabling copy-paste for a textbox control

i have a registration form.
i have two text fields 1.password 2.confirm password
can anybody help me to find out
how to disable copy - paste for a (confirm password) text box control
both by keyboard and mouse right click ?

 
Old November 27th, 2007, 04:53 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You could overwrite the KeyPress event and suppress the pressing of the Ctrl+V key combination. Likewise you could give the control a context menu with no items on it which should override the default one.

/- Sam Judson : Wrox Technical Editor -/
 
Old November 27th, 2007, 05:24 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks sam.

 
Old October 21st, 2008, 03:41 PM
Registered User
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This code works well,

But it is also possible to paste with MouseRightClick and Paste command. I don't want to disable the contextMenu because I will allow to copy the text, but not paste.






Similar Threads
Thread Thread Starter Forum Replies Last Post
copy paste !!!!!!! dpkbahuguna Beginning VB 6 1 March 30th, 2007 10:06 AM
Copy, Paste dpkbahuguna Beginning VB 6 1 October 26th, 2006 10:30 AM
copy and paste url k.manisha ASP.NET 1.0 and 1.1 Professional 1 October 14th, 2006 05:15 AM
Disabling copy/paste in both IE & Netscape Mekala HTML Code Clinic 0 July 2nd, 2004 04:24 AM
Copy and append paste canmex Access 2 October 7th, 2003 01:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.