Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Object Name as Variable
Message
From
10/11/2001 07:40:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/11/2001 07:15:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00580107
Message ID:
00580123
Views:
16
>This is more what I need to get to work:
>
>For x = 1 To 17
> ThisForm.Shape(x).BackColor = RGB(0,0,255)
>Next x

All same color ? If so just :

ThisForm.SetAll('BackColor',RGB(0,0,255),'Shape')

Otherwise what you show needs a control array. Probably all shapes are named Shape1...Shape17. If so :
For x = 1 To 17
 with eval('ThisForm.Shape'+ltrim(str(x))
   .BackColor = RGB(0,0,255)
 endwith
Next x

* Mimic a control array
* Form has custom array property myShapes
* Each shape adds a reference to self in its init to array
* Or a form method does it once
For x = 1 To 17
 ThisForm.myShapes[x].BackColor = RGB(0,0,255)
Next x
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform