Is there a way to check if a combo box or listboxitem is showing on the screen?

If there are many items in the list, is there a way (programmatically) to check if the item is visible on screen.

For example, a list contains 100 items, but only the first 24 are shown on the screen, is there a way to check if a specific one is displayed (eg list [75]), or do I have to scroll to see it?

0


a source to share


2 answers


Try this: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/2d527831-43aa-4fd5-8b7b-08cb5c4ed1db/



+1


a source


Check out Calculating the number of visible items in a ListBox and find my post below.

I've seen a lot of tricky answers that are wrong.



Short answer: (listBox1.Height / listBox1.ItemHeight)

0


a source







All Articles