---
title: "VirtualListView..::.FindNearestItem Method (Int32, Int32)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_VirtualListView_FindNearestItem_2_22dcb54d.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# VirtualListView.FindNearestItem Method (Int32, Int32)
 
Finds the item nearest to the specified coordinates. Search is supported only in icon and list modes.
 
**Namespace:** [Aurigma.GraphicsMill.WinControls](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.WinControls (in Aurigma.GraphicsMill.WinControls.dll)
 
## Syntax
  
```
Public Function FindNearestItem ( _x As Integer, _y As Integer _
) As Integer
```
 
```csharp
public int FindNearestItem(int x,int y
)
```
 
### Parameters
 
 - x
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
X-coordinate of the position to test.

 - y
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Y-coordinate of the position to test.
 
### Return Value
The index of the item if successful, or -1 otherwise.
   
## See Also

### Reference

- [VirtualListView Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_VirtualListView.htm.md)
- [FindNearestItem Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_WinControls_VirtualListView_FindNearestItem.htm.md)
- [Aurigma.GraphicsMill.WinControls Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
