VB.NET Program – Age Calculator : This program will explain to calculate age by entering Date of Birth and Current date. After entering date of birth and Current date it will display birth day in the date of birth datetime picker and current day will display in the till now date time picker. In the result label it will display age in years with month and days. This is developed in VB.NET works with a very simple logic.
VB.NET Program – Age Calculator
The above screenshot is the form design of the age calculator. This is designed with 3 labels, 2 date time picker and one submit button to calculate age. The date of birth, current date input and result everything works in the single form.
Source code: In the source code four variables created. Date of birth stores in datevalue1 and current date stores in datevalue2. After the substraction its result stores in datet. 3 different formulas used to calculate year, month and days. The difference stores in diff variable.
Download Example Program: This example code of age calculator developed using Visual studio 2012 version and it works well in visual studio 2013.