Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a control at runtime??
Message
From
03/06/1999 15:45:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00226170
Message ID:
00226180
Views:
21
>I build a shape based on some data. I would like to have another copy of the shape. Is there a quick way to copy all the layout properties of an object or do I have to code each property indivually -- shp2.top = shp1.top, shp2.left = shp1.left, etc...? There are actually dozens of shapes I need to copy, so this could be a big time saver. Thanks for any feedback.
>

You can use AMEMBERS(object name,1) to create an array of properties, instantiate a new instance of the class, and then spin through the array copying the value from one to the other. Some properties are read-only at runtime, so you'd need to trap errors resulting from trying to write to a read-only property...

>Marcus.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform