Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Iterate through Grid Header Controls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01367063
Message ID:
01367100
Vues:
8
Ron, the trick I was looking for was what you did in your code:
this.column&lcix..header1.Caption = ;
I wasn't quite sure how to use the macro expansion here. I didn't realize that you could place the macro expanding variable right next to the "this.column" and have it work. This worked very well. My code is different based on the needs, but your code gave me the clue I was looking for.

I was starting with Column 2 and completing with Column 7. The nRecs is based on the number of records in a cursor (which contains the Header captions) to give me the amount of columns out of 6 available that I was going to use. In the example case I am doing, only 3 columns were necessary. The first column's caption is pre-defined. Part of my code follows:
i = 2
FOR i = 2 TO (nRecs + 1)
	lcIx = ALLTRIM(STR(i))
	.Column&lcIx..Header1.Caption= + ;
I keep hearing about iterating through a collection, but I have not yet understood this and there is little in the books I have to really explain it thoroughly; although I find it quite useful and interesting, I'd like to see some place where it is explained more fully.

Thank you very much!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform