检查选择的项目是可见[详细虚拟的ListView查看] [英] Check if selected item is visible [virtual ListView in details view]
问题描述
有没有什么好的/短路解决SUBJ?
我能想到的:
-
GET
TopItem
指数(在VirtualMode
可它为空创建项目前?),如果所需项目的索引是更小,它是无形的,否则得到底部可见指数(指数成分股+listView.ClientSize.Height / GetItemRect(TopItem).Height
),如果指数收集所需要的产品越多,那么它是无形的。否则可见。 -
不知怎么检测滚动和做一些事情。
或者,也许还有一个更简单的方法?
<$p$p><$c$c>listView1.Items[SelectedItemIndex].Bounds.IntersectsWith(listView1.ClientRectangle)
这将解决您的问题。
Is there any good/short solution to the subj?
I can think of:
get
TopItem
index (inVirtualMode
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?
listView1.Items[SelectedItemIndex].Bounds.IntersectsWith(listView1.ClientRectangle)
This will solve your problem.
这篇关于检查选择的项目是可见[详细虚拟的ListView查看]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!