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);
}
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: display year in Combo Box, Populate Year in List / Combo Box
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home