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.

Recommended Answers

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.

Jump to Post

All 5 Replies

Re: Age Date Validation 80 80

You can simply disable textBox:

txtage.Enabled = false;
Re: Age Date Validation 80 80

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".

Re: Age Date Validation 80 80

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.

Re: Age Date Validation 80 80

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.

Re: Age Date Validation 80 80

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.