TextBox Validation

  • Thread starter Thread starter Mariame
  • Start date Start date
M

Mariame

Hi Everyone
I have a textbox that i created online in Form Load:
"Dim TB1 as new TextBox"
I want to validate that this textbox contains numbers only???
Is There is a way i can do it uing VisualBasic???
Thx in Adv
 
Mariame said:
Hi Everyone
I have a textbox that i created online in Form Load:
"Dim TB1 as new TextBox"
I want to validate that this textbox contains numbers only???
Is There is a way i can do it uing VisualBasic???
Thx in Adv

You are adding the TextBox dynamically?
Add a CompareValidator as well. Set several properties:
- ControlToValidate needs the value of the ID-property of the TextBox
- Operator is DataTypeCheck
- Type is Integer
and you might want to set the ErrorMessage...

Hans Kesting
 
Back
Top