Cool code. But as you scroll down the list box the accuracy changes. Like I set the list to 120 records and the code was correct upto about 40 then it was inaccurate until, by the time I reached the last record it was displaying the value exactly 1 row up from where it actually was.
>>I would like to know how to get the value, or at least the ItemId or
>>ListItemId of the current item under the mouse in the listbox without
>>clicking on it. Mind you, the list box could be scrolled to the
>>middle of the list, but whatever is under the mouse, that is what I
>>want.
>>
>>Any thoughts?
>>
>>I know that I can use the MouseMove event to get the coords, but how,
>>if at all, do I determine what list item the mouse is over?
>>
>>David
>
>
>Hi David,
>
>Try this:
>
>*** Listbox MouseMove events
>Local lc_FontStyle, ln_FontHeight, ln_Index
>
>With This
> lc_FontStyle = iif( .FontBold, 'B', '' ) + iif( .FontItalic, 'I', '' ) + ;
> iif( .FontUnderline, 'U', '' )
> ln_FontHeight = FontMetric( 1, .FontName, .FontSize, lc_FontStyle ) + ;
> FontMetric( 4, .FontName, .FontSize, lc_FontStyle )
>
> ln_Index = .TopIndex + int((nYCoord - .Top) / ln_FontHeight)
> * .ListIndex = ln_Index
> Wait .List( ln_Index ) window nowait
>EndWith
>
>
>HTH