>*- the following codes try to add property and method for a command button
>aSelObj(aArray)
>o=aArray(1) && store a reference of a command button in form designer
>o.AddProperty('test_p','1')
>o.WriteMethod('test_m',"? ok ",.t.) &&the .t. means create new method
>
>Ok, it seems ok, the property inspect window shows what i had added,
>the new property and the new method. Then open the scx file by a use,
>what i add is there.
>
>Great, i think i can write a short routine to add properties and
>methods for objects containing in a form on design time. My code will
>be more good...
The actual bug is that this shouldn't work on anything but the class/form you're editing - that's what you can do from the menu, and it shouldn't allow you to add properties/methods to the members. Still, it allows you to do that, and then loses it. IMO, the bug is not that it loses it, but that it lets you do it.
The morale of the story: use this only for the outermost object (form or class you're editing), not on its members. As to doing it with the button, you can do it on the button's class, as Vlad said.