Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mouseover Listbox - what is under the cursor?
Message
De
16/07/2004 10:16:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/07/2004 18:18:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00924946
Message ID:
00925154
Vues:
22
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform