1 Replies - 609 Views - Last Post: 20 November 2012 - 06:38 AM Rate Topic: -----

#1 beegee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-October 08

how do i capture event to validate a textbox

Posted 20 November 2012 - 06:26 AM

i have numerous textboxes on my form that i want a user to fill up. I want a situation whereby when u user types in invalid data like non numeric letters in a numeric only textbox a label will appear notifying that its a numeric only textbox and returns focus to that textbox. so my question is how do i perform this validation. currently my code does not allow the user to input anything other than numbers only
Is This A Good Question/Topic? 0
  • +

Replies To: how do i capture event to validate a textbox

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,775
  • Joined: 26-March 09

Re: how do i capture event to validate a textbox

Posted 20 November 2012 - 06:38 AM

You can set the CausesValidation property to true on the textboxes and then handle what you need in the Validate event.

This event is raised when the user leaves that textbox.

If you want to capture it at keypress level then use one of the Key events.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1