Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic button labels - How do I?
Message
From
19/10/2000 15:35:14
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00431739
Message ID:
00431755
Views:
14
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform