"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