CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Textbox Validation On Pasting Text In. Plz Post Answer!

    Hello Im using vs2005. My problem is that Im putting some validations on a form.
    There is a textbox which I allow only numeric keys to be entered.I put a validation in the keypress event and it's working alright. But it's only when Im keying the character that it will validate the entries! If I have alphanumerics characters in the clipboard and paste in the textbox, my validations are violated! There are alphanumeric characters in my textbox where there should only numeric keys.

    Can somebody help me out there? What I would like to do is to validate the text before it goes in the textbox. How can I do this?

    Thanks in advance for your reply.

    Regards.

  2. #2
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: Textbox Validation On Pasting Text In. Plz Post Answer!

    You should put the validation code in the handler for the TextChanged or Leave event...
    It's not a bug, it's a feature!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured