System.Windows.Forms.ListView.FindNearestItem Method

Finds the next item from the given x- and y-coordinates, searching in the specified direction.

Syntax

public ListViewItem FindNearestItem (SearchDirectionHint searchDirection, int x, int y)

Parameters

searchDirection
One of the System.Windows.Forms.SearchDirectionHint values.
x
The x-coordinate for the point at which to begin searching.
y
The y-coordinate for the point at which to begin searching.

Returns

The System.Windows.Forms.ListViewItem that is closest to the given coordinates, searching in the specified direction.

Remarks

The erload:System.Windows.Forms.ListView.FindNearestItem method returns null if no item is found in the given direction. Identifying the nearest item can vary depending on the operating system the application is running on, and will affect the results of ListView.FindNearestItem(SearchDirectionHint, int, int).

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0