/// <Summary>
/// Obtain the start date of the specified week in the specified month
/// </Summary>
/// <Param name = "year"> year </param>
/// <Param name = "month"> month </param>
/// <Param name = "index"> weeks </param>
/// <Returns> </returns>
Private DateTime GetStartDayOfWeeks (int year, int month, int index)
{
If (year <1600 | year> 9999)
{
MessageBox. Show ("the year has exceeded ");
Return DateTime. MinValue;
}
If (month <0 | month> 12)
{
MessageBox. Show ("month error ");
Return DateTime. MinValue;
}
If (index <1)
{
MessageBox. Show ("weekly error ");
Return DateTime. MinValue;
}
DateTime startMonth = new DateTime (year, month, 1); // the first day of the month
Int dayOfWeek = 7;
If (Convert. ToInt32 (startMonth. DayOfWeek. ToString ("d")> 0)
DayOfWeek = Convert. ToInt32 (startMonth. DayOfWeek. ToString ("d"); // the day of the week on the first day of the month
DateTime startWeek =