int myAge = DateTime.Today.Year - dateTimePicker1.Value.Year; // CurrentYear - YourBirthDate textBox1.Text = myAge.ToString();
DateTime
DateTimePicker
DateTime dt = dateTimePicker1.Value;
TimeSpan ts=DateTime.Now - Convert.ToDateTime(datePicker.SelectedDate); int age = Convert.ToInt32(ts.Days) / 365;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)