Help needed for Validation

prav_roy

Well-known member
Joined
Sep 10, 2005
Messages
70
Location
Mumbai
Programming Experience
1-3
hi,
i want to validate the text entered into the textbox is integer or not..if not integer then i want to display an error.. how can i carry out this using custom validation.. or can i make use of any other validation controls for this pupose..

thank you
 
The textbox class raises it's own validation events. So in the on validation event handler do a test for numeric values, if not you can display a message box and cancel the event.
 
Validation

I'm using VB.NET and need to cancel an event if the entry is not numeric.

I used e as System.Component.CancelEventArgs
I used e.Cancel = True

But it just seems to hang on the text, rather than cancel.

Ex: I enter SA instead of a number into a combobox.
I want the combobox to simply cancel the entry of SA. If there was a number in there previously, I want that number to stay.
 
Back
Top