Go to the monthCalendar in your form and right click. Select Properties. Then click Events and double-click DateSelected.
This will be generated by VS2010:
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
{
}
Inside that method use e.Start.ToShortDateString()
to capture the date that was selected and assign it to the appropriate index of your array.
Update in regards to your question in the comments/ newly posted code:
From what I can tell about your project, this might be the best solution for you (without having to completely restructure everything). Add another text box (name it dateBox). Then inside the DateSelected method add the following code:
dateBox.Text = e.Start.ToShortDateString();
Then inside your Click method that you have posted (assuming that your Meeting class has some sort of Date property) add the following code:
m.Date = dateBox.Text;
Update
Alternatively (and much more simply - I don't know why I didn't suggest this before), you could just define a global string
in your form called dateStr and use that to hold the information for the date of the meeting until you click "save changes" and then assign it to m.Date
. That would be a much more simpler solution than creating another textbox (which is probably what you're trying to avoid anyway).