Imports Infragistics.Win.UltraWinSchedule
...
Private Sub UltraMonthViewSingle1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles UltraMonthViewSingle1.MouseDown
' If mouse click isn't right mouse click exit
If Not e.Button = System.Windows.Forms.MouseButtons.Right Then Exit Sub
Dim point As System.Drawing.Point
point = New System.Drawing.Point(e.X, e.Y)
' Determine where in the control the right button was pressed
Dim objAppointment As Appointment
Dim objHoliday As Holiday
Dim objNote As Note
Dim objWeek As Week
Dim objDay As Day
Dim objDayOfWeek As DayOfWeek
objAppointment = Me.UltraMonthViewSingle1.GetAppointmentFromPoint(e.X, e.Y)
If Not objAppointment Is Nothing Then
' objAppointment found
MessageBox.Show("Appointment " + objAppointment.Subject.ToString())
End If
objHoliday = Me.UltraMonthViewSingle1.GetHolidayFromPoint(e.X, e.Y)
If Not objHoliday Is Nothing Then
' objHoliday found
MessageBox.Show("Holiday " + objHoliday.StartDate.ToString())
End If
objNote = Me.UltraMonthViewSingle1.GetNoteFromPoint(e.X, e.Y)
If Not objNote Is Nothing Then
' objNote found
MessageBox.Show("Note " + objNote.Date.ToString())
End If
objWeek = Me.UltraMonthViewSingle1.GetWeekFromPoint(e.X, e.Y)
If Not objWeek Is Nothing Then
' objWeek found
MessageBox.Show("Week " + objWeek.WeekNumber.ToString())
End If
objDay = Me.UltraMonthViewSingle1.GetDayFromPoint(e.X, e.Y)
If Not objDay Is Nothing Then
' objDay found
MessageBox.Show("Day " + objDay.DayNumber.ToString())
End If
objDayOfWeek = Me.UltraMonthViewSingle1.GetDayOfWeekFromPoint(e.X, e.Y)
If Not objDayOfWeek Is Nothing Then
' objDayOfWeek found
MessageBox.Show("Day of the Week " + _
objDayOfWeek.DayOfTheWeek.ToString())
End If
End Sub