Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic button labels - How do I?
Message
De
19/10/2000 15:35:14
 
 
À
19/10/2000 15:34:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00431739
Message ID:
00431755
Vues:
16
>>I have a form that has 20 buttons. I want to set each button label based on a table that may change from time to time i.e. button 1 label = record 1, Button 2 label = record 2 etc. How do I go about doing this? Any help would be great.
>>Thanks
>>Bill Pritchard
>
>In the Init method of your form you could have code that goes through all the controls on the form, lloking for command buttons. When you find one, change it's caption.
>
>nCounter = 0
>FOR EACH oCtrl IN thisform
>  IF oCtrl.BaseClass="Commandbutton"
>    nCounter = nCounter + 1
>    oCtrl.Caption = "Record "+ALLTRIM(STR(nCounter))
>  ENDIF
>ENDIF
>ENDFOR
>
Gah! that should be:

FOR EACH oCtrl IN thisform.Controls
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform