Frage

Is there any good/short solution to the subj?

I can think of:

  • get TopItem index (in VirtualMode can it be null before item is created?), if index of needed item is less, then it is invisible, otherwise get bottom visible index (top index + listView.ClientSize.Height / GetItemRect(TopItem).Height) and if index of needed item is more, then it is invisible. Otherwise visible.

  • detect scrolling somehow and do something.

Or maybe there is an easier way?

War es hilfreich?

Lösung

listView1.Items[SelectedItemIndex].Bounds.IntersectsWith(listView1.ClientRectangle)

This will solve your problem.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top