public DayFromPoint ( Point pt, bool exact ) : DateTime? | ||
pt | Point | Point to lookup. |
exact | bool | Exact requires that the day must be with the month range. |
return | DateTime? |
/// <summary> /// Gets the button for the day that is under the provided point. /// </summary> /// <param name="pt">Point to lookup.</param> /// <param name="exact">Exact requires that the day must be with the month range.</param> /// <returns>DateTime for matching day; otherwise null.</returns> public DateTime?DayFromPoint(Point pt, bool exact) { // Get the bottom most view element matching the point ViewBase view = ViewFromPoint(pt); // Climb view hierarchy looking for the days view while (view != null) { ViewDrawMonthDays month = view as ViewDrawMonthDays; if ((month != null) && month.ClientRectangle.Contains(pt)) { return(month.DayFromPoint(pt, exact)); } view = view.Parent; } return(null); }