Weird ListBox Issue

RobEmDee

Centurion
Joined
Mar 25, 2003
Messages
130
Location
Richmond, VA
I have a UserControl with a DataGrid and a UserControl with a ListBox both running inside of the same form. The ListBox is loaded with a fixed number of items when the form is instantiated. The number of items in the grid periodically changes throughout the life of the form.
I use ListBox.IndexFromPont() in the MouseMove event of the ListBox to retrieve information about the objects in the ListBox items collection. It has worked quite well for some time. However, today the IndexFromPoint() method began returning indices starting at 19 (e.g item 1 = index 19, item 2 = index 20, item 3 = index 21, etc). The only kind of pattern or correlation I have been able to find is that when the number of items in the grid gets up around 50 or greater, this ListBox issue begins happening. If the grid only has a few items, this issue does not happen. Has anyone seen anything like this before!?
 
Back
Top