.Net Links

Tuesday, October 6, 2009

Display Year in the combo box

The following code will display year in the following manner

Current year - 10
Current year - 9
..............
Current year
Current year + 1


int year = DateTime.Now.Year;

for (int i = year - 10; i <= year + 1; i++)
{

cbxYear.Items.Add("" + i);

}

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home