Date within month calender selection range
Okay, this seems like a simple issue, but i want to iterate through each date that is selected on a month calender control. Am I missing something obvious?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Aug 1, 2009, 2:36 AM
private void button1_Click(object sender, EventArgs e){
DateTime start = monthCalendar1.SelectionRange.Start;
DateTime end = monthCalendar1.SelectionRange.End;
for (DateTime d = start.Date; d <= end.Date; d= d.AddDays(1))
{
listBox1.Items.Add(d.Date.ToString());
}
}
patrickPosted Aug 3, 2009, 10:21 PM