Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Supermover and PKs
Message
De
21/03/2003 16:33:41
Peter Easson
Catalina Trading
Sydney, Australie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00768363
Message ID:
00768793
Vues:
16
OK,
With my subclass of Combo, I added an array called aPicklist in the class designer so that it was always available for all child classes. I also added a property called PKValue. The code for the InteractiveChange event in the 1st Child was
if This.ListIndex > 0
   This.PKValue = This.PickList[This.ListIndex,1]
endif
For any subclass from now on, during its Init, create another array (from for example) a Select statement like
SELECT PKCUST,cName,cSurname from CUST where cSurname = "COX" into array aArray
and the rest would be
 ACOPY(aArray,This.aPickList)
for m.i = 1 to alen(aArray,1)
   This.AddItem(This.aPickList[m.i,2] + This.aPickList[m.i,3],m.i,1)
endfor
&& if you want to make the first item the default
This.Selected(1) = .t.
THis.PKValue = This.aPicklist[This.ListIndex,1]
DoDefault()
Now, everytime the user changes the seletion in the Combo, the real PK value is always available with This.PKValue

Hope this helps

Pete
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform