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:32:48
 
 
À
16/07/2004 10:16:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00924946
Message ID:
00925640
Vues:
20
Thanks mate. This code works perfectly. Herman's code suffered in that the more you scrolled the more inaccurate it became. With the same table your code worked correctly.

Cheers and thanks

>>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
>
>
>*Listbox init
>*... code if any
>* Save rowheight to a property
>Thisform.Newobject('lblDummy','Label')
>With Thisform.lblDummy
>  .AutoSize = .T.
>  .Left = -100
>  .FontName=This.FontName
>  .FontSize=This.FontSize
>  .FontBold = this.FontBold
>  .FontItalic = this.FontItalic
>  .FontUnderline = this.FontUnderline
>  .Caption = .Caption
>  .Visible = .T.
>  This.AddProperty('nRowHgt',.Height)
>Endwith
>Thisform.RemoveObject('lblDummy')
>
>* Listbox mousemove
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>Local lnOnRow
>With this
>  lnOnRow = ceiling( ( nYCoord - Objtoclient(this,1) - 1 ) / .nRowHgt )
>  Wait window nowait "On : " + .List(m.lnOnRow + .TopIndex - 1)
>endwith
>
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform