Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array of controls, buttons, checkboxes????
Message
 
À
25/10/1999 22:44:47
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00281367
Message ID:
00281423
Vues:
14
>Is there a way to create a double dimensioned array of items such as checkboxes. I am attempting to make a calendar control and it would be alot easier to set my "grid" of 6 rows by 7 columns properties accordingly using an array instead of physically coding ... "thisform.box1.caption="1", thisform.box2.caption="2",... and using something line "thisform.box(r,c).caption=counter". Any suggestions?
>
>Thanks

Yes you can. Add a property to the form with the name Box(1). Place all of your checkboxes in a container. In the container's Init do this;
WITH Thisform
   DIMENSION Box(6,7)
   .Box(1,1) = This.chkBox1
   .Box(1,2) = This.chkBox2
   .Box(1,3) = This.chkBox3
   .Box(1,4) = This.chkBox4
   .Box(1,5) = This.chkBox5

   ...

ENDWITH
Now you can iterate through the checkboxes with;
WITH Thisform
   FOR x = 1 TO 6
      FOR y = 1 TO 7
         .Box(x,y).Value = Whatever
      ENDFOR
   ENDFOR
ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform