Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating buttons on the fly
Message
 
 
To
23/11/2001 10:34:30
Mario Glas
ProSysPlus Europe
Weert, Netherlands
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00585132
Message ID:
00585135
Views:
17
FOR lnCntr = 1 TO ...
  * Create name for the current button
  lcButtonName = "Mybutton" + TRANSFORM( lnCntr )
  * Add button to form
  ThisForm.addobject( lcButtonName, "myclasslib")
  * Get reference to it
  loButton = EVAL( "ThisForm." + lcButtonName )
  * Change properties
  WITH loButton 
      .Caption = "..."
      .Top = ...
      .Left = ...
      ...
  ENDWITH
ENDFOR
>Hi,
>
>I want to create a number of buttons every time a user resizes that form.
>The number of buttons is different every time.
>
>The name of the button is in a variable + a unique number.
>When i create the button with ThisForm.addobject(variable-name,classname), i cann't use the variable-name anymore to change the properties of the button
>
>How can i change the properties of these buttons because i cann't call a button with the variable name ?
>
>The source code is in "For" loop for every time this button has to be created.
>
>Who can help me, i'm just starting with FoxPro.
>
>Mario Glas
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform