.Net Links

Tuesday, October 6, 2009

Display Months in Combo box

The following code will display Month Name from Jan ...Dec in the combo box.

DateTime dt = new DateTime();

for (int i = 0; i < 12; i++)
{
cbxMonth.Items.Add(dt.AddMonths(i).ToString("MMMM"));
}

Labels: , , ,