HeaderPane
Main
Hide
Share Link
Print

HitTest Method, SftCalendar Object

Determines the part of the calendar at a location.

Syntax

C#SftDateCalendarHitConstants Area = object.HitTest(int xPos, int yPos, out object Date);
VB.NETArea = 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);
CHRESULT object->raw_HitTest(long xPos, long yPos, VARIANT* Date, enum SftDateCalendarHitConstants* Area);

object

A SftCalendar 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.

NameValueDescription
calHitSftDateNowhere0Outside the control
calHitSftDateBackground1Background
calHitSftDateTitle2Title
calHitSftDatePreviousButton3Previous button
calHitSftDateNextButton4Next button
calHitSftDateDayOfWeek5Day of the week header
calHitSftDateWeekNumber6Week number
calHitSftDateDay7Day
calHitSftDateTrailingDay8Day of an adjacent month
calHitSftDatePeriod9Month, year or decade (year, decade and century views)
calHitSftDateTodayButton10Today button
calHitSftDateClearButton11Clear button

Comments

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


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.