Age Date Validation
I have a Textbox named txtage.text.Now I want When Insert in txtage.text as 30/12/1980.
disable tabindex.and messagebox show "You can not give admission".If Insert in txtage.text as 30/12/2005.
Enable Tab index .its mean student 's age must be 6 year not greater nor less.
yousafc#
Junior Poster in Training
82 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1
You can simply disable textBox:
txtage.Enabled = false;
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
Hello Sir this is not Solution of my question I want Students age must be minimum 6 years old.If Student's age is 10 years old Messagebox show "You can not admit in this School".
yousafc#
Junior Poster in Training
82 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1
Why not use a DateTimePicker control to input a date, instead of a TextBox?
A DateTimePicker has ValueChanged and Validating events you could use to check the date entered and act accordingly.
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
I have a Textbox named txtage.text.Now I want When Insert in txtage.text as 30/12/1980.
disable tabindex.and messagebox show "You can not give admission".If Insert in txtage.text as 30/12/2005.
Enable Tab index .its mean student 's age must be 6 year not greater nor less.
1st of all, your post in not clear. Make is so, if you wanna help from us.
About what/which tabIndexes are you talkin about?
And when you work with dates, its best to use a control which is meant for it - so dateTimePicker as ddanbe told you.
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
Ok this thread is solved by ddanbe.It should be datetimePicker.and So Sorry Mitja I could not explain,what i'm want to do.
yousafc#
Junior Poster in Training
82 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1