This works for me
int FindFirstVisibleItem(Rectangle rectangle)
{
foreach (ListViewItem item in Items)
{
if (item == null) continue;
if (rectangle.IntersectsWith(item.Bounds))
{
Invalidate();
return item.Index;
}
}
return -1;
}
and call it as in as follows
int firstVisibleItem = FindFirstVisibleItem(new Rectangle(0, 0, e.Bounds.Width, e.Bounds.Height));
if (e.ItemIndex == firstVisibleItem)
e.Graphics.DrawRectangle(Pens.Red, e.Bounds);