Israel

Israel

  • NA
  • 1.3k
  • 204.1k

DateTimePicker professional

Sep 2 2014 12:44 PM
Hi!
 
I need to get the exact age of each worker.
I do something very and very simple. Its works but it'snt professional.
On my form I put three textboxs with a button (txtCurrentYear, txtYearOfBorn, txtAge and btnAdd). Then see my code:
 
private void btnAdd_Click(object sender, EventArgs e)
{
float first;
float second;
float output;
first = Convert.ToInt32(txtCurrentYear.Text);
second = Convert.ToInt32(txtYearOfBorn .Text);
output = first - second;
txtAge.Text = output.ToString();
}
What I need to learn. I would like to use the "dateTimePicker" with a "label". Means when I choose a date on my DateTimePicker its should show on my "label" the age (ex. 39)
 
Thanx,
Israel.

Answers (1)