Hi Folks
I have a textbox that uses a KeyPress event to test for numeric values; anything typed in other than a number generates a beep and the character is ignored. Unfortunately it seems that it also short-circuits the text box's ability to accept a paste or Ctrl_V command to paste in a series of numbers like a product number. I personally don't care but the users are complaining...
I figure the answer is to check for and allow a ctrl_V or paste operation to take place and only run the test if an actual single key is pressed. I realize that it may allow the users to put anything in the field including spaces or letters, but they insist that's the way they want it!
Anyway, I'm having trouble trying to figure out how to test for the paste commands in the KeyPress routine. Does anyone have a suggestion on how I might do this?
Thanks
CraigHartz
I have a textbox that uses a KeyPress event to test for numeric values; anything typed in other than a number generates a beep and the character is ignored. Unfortunately it seems that it also short-circuits the text box's ability to accept a paste or Ctrl_V command to paste in a series of numbers like a product number. I personally don't care but the users are complaining...
I figure the answer is to check for and allow a ctrl_V or paste operation to take place and only run the test if an actual single key is pressed. I realize that it may allow the users to put anything in the field including spaces or letters, but they insist that's the way they want it!
Anyway, I'm having trouble trying to figure out how to test for the paste commands in the KeyPress routine. Does anyone have a suggestion on how I might do this?
Thanks
CraigHartz