Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One class, two behaviors
Message
 
 
À
09/09/1998 11:34:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00134266
Message ID:
00134766
Vues:
11
Pamela,

As the cbo instantiates before the Init event occurs it scans the RowSource to construct it's internal list of items to display. When this happens the array is most likely defined as being 1 element long in your class property definition right? So that's why the cbo only shows 1 item when you drop the list. When you fill the array during the Init you've basically undone the internal processing of the list that has already occurred. Just adding a this.Requery() at the end of the Init() and you should be fine.

If you'd have declared the array aItems[100] in the New Property dialog you'd see a 100 item long list with some of the items as .f. if your Init() code hadn't processed the whole array or redimensioned it.

There really isn't a reason why it works when placed on a form vs. placed inside another class that's then used on a form. It shouldn't be working when it's directly on a form, I suspect that you may have code somewhere else that either resets the NumberOfElements or issues a Requery() for the cbo. If not it's a bug.

>I populate the array in the Init of the combobox. I sort of thought that was what an Init method is for. Besides, the combobox doesn't think the array is empty, its more as though the form class sees the array as a single character variable instead of an array. There must be something not directly related to the combobox in the form class that is confusing it. I just can't for the life of me figure out what it is.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform