TextBox Validation

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
 
H

Hans Kesting

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,269
Latest member
vinaykumar_nevatia23

Latest Threads

Top