Determines the part of the calendar at a location.
| C# | SftDateCalendarHitConstants Area = object.HitTest(int xPos, int yPos, out object Date); |
| VB.NET | Area = object.HitTest(ByVal xPos As Integer, ByVal yPos As Integer, ByRef Date As Object) As SftDateCalendarHitConstants |
| C++ | enum SftDateCalendarHitConstants Area = object->HitTest(long xPos, long yPos, VARIANT* Date); |
| C | HRESULT object->raw_HitTest(long xPos, long yPos, VARIANT* Date, enum SftDateCalendarHitConstants* Area); |
object
xPos
The x coordinate in pixels, relative to the control's client area.
yPos
The y coordinate in pixels, relative to the control's client area.
Date
Returns the date at the location: the day, the first day of a period or of the title's period, or the first day of the week of a week number. Null for the other parts.
Area
Returns the part of the calendar at the location.
| Name | Value | Description |
|---|---|---|
| calHitSftDateNowhere | 0 | Outside the control |
| calHitSftDateBackground | 1 | Background |
| calHitSftDateTitle | 2 | Title |
| calHitSftDatePreviousButton | 3 | Previous button |
| calHitSftDateNextButton | 4 | Next button |
| calHitSftDateDayOfWeek | 5 | Day of the week header |
| calHitSftDateWeekNumber | 6 | Week number |
| calHitSftDateDay | 7 | Day |
| calHitSftDateTrailingDay | 8 | Day of an adjacent month |
| calHitSftDatePeriod | 9 | Month, year or decade (year, decade and century views) |
| calHitSftDateTodayButton | 10 | Today button |
| calHitSftDateClearButton | 11 | Clear button |
The HitTest method returns the part of the month calendar control at a location and the date it represents, for example to show a context menu or a tooltip for a day. p The location of a mouse event (MouseDown) can be passed directly, as its coordinates are pixels relative to the control.
See Also SftCalendar Object | Object Hierarchy | Hit Testing