Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding items to 2nd column of Combo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00396237
Message ID:
00396241
Vues:
12
Hi George.

>> FOR i = 1 to 10
this.Combo1.AddItem(STR(i),i,1)
this.Combo1.AddItem("Colm 2"+STR(i),i,2)
NEXT <<

This is because the combo's AddItem method does not work as advertized. The addItem method actually adds an entire row to its RowSource. So, in order to make it work, you need code like this:
FOR lnItem = 1 TO lnItemCount
  WITH This.Combo1
     .AddItem( 'My Cool New Item' )
     *** This populates column 2 of the newly added row
     .List[ .NewIndex, 2 ] = 'The second cool column'
  ENDWITH
ENDFOR
Otherwise, you will have to use the combo's ListItem (and corresponding AddListItem method) collection. This method works as advertized.

Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform