private void monthCalendar1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { System.Windows.Forms.MonthCalendar.HitTestInfo hTest = monthCalendar1.HitTest(this.PointToClient(Control.MousePosition)); System.Windows.Forms.MonthCalendar.HitArea hArea = hTest.HitArea; if (hArea == System.Windows.Forms.MonthCalendar.HitArea.Date) { OnSelectionChanged(); this.Close(); } }
internal HitTestInfo(System.Drawing.Point pt, System.Windows.Forms.MonthCalendar.HitArea area, DateTime time) { this.point = pt; this.hitArea = area; this.time = time; }