Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counting objects
Message
De
20/08/2001 15:40:35
 
 
À
20/08/2001 15:36:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00546396
Message ID:
00546406
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>>Is there a way programmatically to know how many objects are open on a form?
>>
>>I have a form with six check boxes on it, and as they're named "Check1", "Check2", etc., I run a loop to pull their values for further processing.
>>
>>In the near future, we'll add about four more checks, and an unknown number after that. Currently, all I have to do is add the new object and change the parameters of the loop, but I'd like to be able to simply add the object and let the program do the counting.
>>
>>Is there a way to determine within the program how many objects named "Check" are on the form and run the loop dynamically?
>>
>>In a similar vein, is it possible to add check boxes dynamically based on data in a table?
>
>One approach could be to loop the Controls collection of the form and check the class property of each object to see if it's = 'CheckBox':
>
For Each oCtl In Thisform.Controls
>   If oCtl.Class = 'Checkbox' Then
>      myCounter = myCounter + 1
>   Endif
>Next
>
>HTH

Actually, it's the Controls array, not collection. But you can still treat it as a collection as far as For Each.. Next goes.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform