G
Guest
I'm having a problem supressing characters in a text box. I only want alpha
numeric characters (no special chars). I can handle the TextBox_KeyPress
event to supress the invalid characters when the user types them in, however
that doesn't handle the user pasting invalid characters. I thought to use
the MouseDown event but I couldn't figure out how to tell if the user is
trying to paste or is copying the text. To paste the text the user would
have to right-click to pull down the context menu and select paste.
My question: How can I tell if the user is trying to paste text to the
textbox?
Is there an event raised on paste?
or do I have to tell the user selected paste from the context menu?
(ok, that's 3 questions)
Thanks in advance
numeric characters (no special chars). I can handle the TextBox_KeyPress
event to supress the invalid characters when the user types them in, however
that doesn't handle the user pasting invalid characters. I thought to use
the MouseDown event but I couldn't figure out how to tell if the user is
trying to paste or is copying the text. To paste the text the user would
have to right-click to pull down the context menu and select paste.
My question: How can I tell if the user is trying to paste text to the
textbox?
Is there an event raised on paste?
or do I have to tell the user selected paste from the context menu?
(ok, that's 3 questions)
Thanks in advance