Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub ultraWeekView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ultraWeekView1.MouseDown
' Use the GetOwnerFromPoint method to get the owner that was clicked, if any
Dim ownerAtPoint As Infragistics.Win.UltraWinSchedule.Owner = Me.ultraWeekView1.GetOwnerFromPoint(e.X, e.Y)
' Use the GetOwnersInView method to get an array of the owners that are
' currently being displayed by the control
Dim ownersInView() As Infragistics.Win.UltraWinSchedule.Owner = Me.ultraWeekView1.GetOwnersInView()
' Get the number of owners currently being displayed by the control
Dim inViewOwnerCount As Int32 = ownersInView.GetLength(0)
Dim msg As String = String.Empty
' Append the noame of the owner that was clicked to the message string
If Not ownerAtPoint Is Nothing Then
msg += ownerAtPoint.Name + " was clicked." + Environment.NewLine
End If
' Append the name of each owner to the message string
msg += "There are currently " + inViewOwnerCount.ToString() + " owners in view:"
msg += Environment.NewLine
Dim i As Int32
For i = 0 To ownersInView.GetLength(0) - 1
msg += ownersInView(i).Name + Environment.NewLine
Next
' DIsplay the information in a message box
MessageBox.Show(msg)
End Sub