Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBox Click
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00602388
Message ID:
00602460
Vues:
24
>Calling the Click event code does not cause a Click to occur, it only runs the >code.

Right, normally. However this.click() placed in the init() of a listbox does not run code placed in this.click(). Only until you "click" an item in the list will this.click() fire.

For example:

mylist.init()
this.click()
mylist.click()
local lnCnt

select mytable
for lnCnt = 1 to this.ListCount
   go record lnCnt
   if mytable.myfield
      this.picture(lnCnt) = [x.bmp]
   else
      this.picture(lnCnt) = [y.bmp]
   endif
endfor
When I "click" the list on any item I get exactly what I want. Otherwise, each time the list is created, no pics until I "click".

>To select an item in a list in code you need to look at the selected property >of the Listbox.

Setting properties in a collection ie.
this.selected(1) = .T.
to highlight the first item works just fine. However, even placing the For loop in this.init() in addition to this.click() does not cause the pics to display until the mouse is used to "click" an item in the listbox.

What I'm getting "in theory" by "clicking" the listitem is,
this.list(listitemId).click()
All I really want to have happen is a bmp shown next to each item based on logic when the listbox is created dynamically in code.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform