Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
For loop
Message
De
07/01/1999 11:44:24
 
 
À
07/01/1999 09:40:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00173475
Message ID:
00173584
Vues:
22
Ding,


>I have about 20 control textbox and i want to change all this backcolor to grey color
>
>i have code :
>
> thisform.textbox1.backcolour = grb(225,225,225)
> thisform.textbox2.backcolour = grb(225,225,225)
> thisform.textbox3.backcolour = grb(225,225,225)
> thisform.textbox4.backcolour = grb(225,225,225)
> ....... so on
>
>
>instead of using so many code to make all textbox to grey color,
>can i use for loop to shorten the code?
>
>i.e.
> for n=1 to 20
> txt1=textbox+alltrim(str(n,2))
> thisform.txt1.backcolor=grb(225,225,225)
> endfor
>



There's another way. Use macro substitution (&) :-

lcTxt1 = 'THISFORM.Text'+ALLTRIM(STR(n,2))+'.BackColor'
&lcTxt1 = RGB(255,255,255)



>
>but is doesnt work!!
>anyone can help me on this
Kenneth.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform