>>I've done it for the OptionGroup - here's the code:
>
>I was looking for a generic way to copy all property values from one object to the other. I came up with a solution, keep following the thread.
Don't have the code at hand, but in the part where it copies properties from old control to the new one, we could build an array of properties, and play with PemStatus() of any of them, and actually copy the non-default ones to the new control. I've done this once for reporting purposes only, but the logic may be extended to copying. Beware of properties like Parent and such, which may be object references - they may lead into wilderness :). This reporting code looked like this:
oso=AMEMBERS(ovaj, _objekat, 1)
for o=1 to oso
do case
* if it's an object member, never mind
case ovaj(o,2)="Object"
case ovaj(o,2)="Event"
* read/WriteMethod here if necessary, though it wouldn't work at runtime, I think - should be done at class level
case ovaj(o,2)="Method"
case ovaj(o,2)="Property"
osob=ovaj(o,1)
* now if a property is different from default
if sys(1269, _objekat, osob, 0)
_text=ptxt
TheProperty=getpem(_objekat, osob)
Aftre this all we have to do is to assign this property to the copy of the control. It would take some Eval() at least, but it's feasible.
This code excerpt was written using recycled bytes.