public void AddDayOfMonthGroupBoxes(CalendarDayDisplay calendarDay, DateTime date, DateTime selectedDate, TableLayoutPanel pnlCalendarTable) { int days = CalendarUtility.NumberOfDaysInMonth(selectedDate); int column = CalendarUtility.FirstDayOfMonthDisplay(CalendarUtility.FirstOfMonth(selectedDate)); int row = 0; for (int i = 1; i < (days + 1); i++, column++) { pnlCalendarTable.Controls.Add(calendarDay.AddDayOfTheMonthGroupBoxes(i, selectedDate), column, row); if (column != 8) { continue; } column = 1; row++; } }
private void AttachCalendarPageLabelsAndGroupBoxesToArrays() { _calendarPageLabelArray = new Label[CalendarUtility.NumberOfDaysInMonth(_selectedDate)]; _calendarPageGroupBoxArray = new GroupBox[CalendarUtility.NumberOfDaysInMonth(_selectedDate)]; int i = 0; int j = 0; foreach (GroupBox item in pnlCalendarTable.Controls.OfType <GroupBox>()) { _calendarPageGroupBoxArray[j] = item; j++; foreach (Label label in (item).Controls.OfType <Label>()) { _calendarPageLabelArray[i] = label; i++; } } }