Thanks for the suggestion. I’ve added this for the next release as:
Calendar.ItemAtPoint(x As Double, y As Double) As CalendarItem
It returns the visible calendar item at the supplied coordinates, or Nothing if the pointer is not over an item. It works in month, week, and day views, including when the week/day view has been scrolled.
For example:
Sub Calendar1_MouseDown(x As Double, y As Double, button As MouseButton)
If button <> MouseButton.Right Then Return
Var item As CalendarItem = Calendar1.ItemAtPoint(x, y)
If item <> Nothing Then
Print("Right-clicked " + item.Title)
End If
End Sub
I used ItemAtPoint rather than FindItem to make it clear that this is coordinate-based hit testing.
Dragging items to reschedule them is a larger, separate feature and isn’t included in this change.