471,616 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Disable clipboard paste in textbox ?

Hi all,

Is it possible to disable pasting from the clipboard into a textbox ?? I
can't find a property for it but I guess it must be possible.

thanks
Steve
Nov 21 '05 #1
2 2837
"Steve" <@> schrieb:
Is it possible to disable pasting from the clipboard into a textbox ??


I am just curious why you need this feature...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
"Steve" <@> schrieb:
Is it possible to disable pasting from the clipboard into a textbox ??


I am just curious why you need this feature...


As a way of preventing invalid characters being entered into a textbox. I
use code with the .keypress event to filter out invalid keystrokes in
textboxes, in order to only allow the user to type certain characters. This
doesn't however prevent them from pasting in invalid characters from the
clipboard, and so to be 100% sure I also have to validate the final text
before use. Disabling paste would mean I wouldn't need that second
validation.

You also often see pasting disabled in forms such as password confirmation,
whereby the user is forced to manually type the password again rather than
just doing a copy/paste.

thanks
Steve


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Du Dang | last post: by
1 post views Thread by fs | last post: by
3 posts views Thread by Stilgar[bbs.isca.uiowa.edu] | last post: by
8 posts views Thread by serge calderara | last post: by
6 posts views Thread by =?Utf-8?B?TWljaGFlbCAwMw==?= | last post: by
3 posts views Thread by Jaez | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.