Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mouseover Listbox - what is under the cursor?
Message
De
18/07/2004 23:29:30
 
 
À
16/07/2004 09:25:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00924946
Message ID:
00925639
Vues:
20
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   && autoselect
>   Wait .List( ln_Index ) window nowait
>EndWith
>
>
>HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform