Version

GetOwnerFromPoint(Point) Method

Returns an Owner object from the specified Point or null if there is no Owner object at the specified Point.

Coordinates are expressed relative to the control's client area.
Syntax
'Declaration
 
Public Overloads Function GetOwnerFromPoint( _
   ByVal point As Point _
) As Owner
public Owner GetOwnerFromPoint( 
   Point point
)

Parameters

point
The Point containing the coordinates to test.

Return Value

The Owner at the specified point or null if none is found.
Remarks

Note: When the control's OwnerDisplayStyle property is set to 'Merged', this method is not applicable and returns null (Nothing in VB).

Example
The following code sample demonstrates how yo use the GetOwnerFromPoint method to find the owner at a specified point in the control's bounds, and how the use the GetOwnersInView method to get the owners that are currently being displayed by the control.

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
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;

		private void ultraWeekView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			//	Use the GetOwnerFromPoint method to get the owner that was clicked, if any
			Infragistics.Win.UltraWinSchedule.Owner ownerAtPoint = this.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
			Infragistics.Win.UltraWinSchedule.Owner[] ownersInView = this.ultraWeekView1.GetOwnersInView();

			//	Get the number of owners currently being displayed by the control
			int inViewOwnerCount = ownersInView.GetLength(0);

			string msg = string.Empty;

			//	Append the noame of the owner that was clicked to the message string
			if ( ownerAtPoint != null )
				msg += ownerAtPoint.Name + " was clicked." + Environment.NewLine;

			//	Append the name of each owner to the message string
			msg += "There are currently " + inViewOwnerCount.ToString() + " owners in view:";
			msg += Environment.NewLine;

			for ( int i = 0; i < ownersInView.GetLength(0); i ++ )
			{
				msg += ownersInView[i].Name + Environment.NewLine;
			}

			//	DIsplay the information in a message box
			MessageBox.Show( msg );
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also