Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
What's the VB.NET code for displaying the age of a person on a label automatically whenever the birth date is entered.
Posted
Comments
Smithers-Jones 26-Sep-11 16:49pm    
Try this:

label1.text = "42"

Doesn't work in all cases, you have to make sure the user is really 42. But then it should be fine.
Sergey Alexandrovich Kryukov 26-Sep-11 19:17pm    
Lovely!
--SA

You could try goolge first: http://www.developerfusion.com/code/4671/calculate-age/[^] was the top hit on a very simple search...
 
Share this answer
 
Look up the DateDiff function. That should get you the code you need.
HTH
 
Share this answer
 
Comments
ChandraRam 28-Sep-11 10:37am    
It is not the down-voting I mind, but would be good if there was a reason for it, and it was specified here. Will help me learning as well. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900