Hi!
Create a container class. Put a control inside it and give it some name. Create a form. Put the object of that container class on the form. Try to change the name of the control inside of the container. VFP will not allow this becaus ethat control is part of the
class.
In your case all is the same - object inside f the form is really a part of the form class (form is also a container), so you cannot change its name.
By the way, changing of the control name is needed very rarely. I wondered, why you need to do this?
>Hi,
>
>If I create simnple form 'myform' and put a button (or any control) on it - say 'mybtn' and then do "Do Form myform" from the command window, I can then go change the name of the button by typing "MyForm.MyBtn.name = 'Homer'" - works fine - and as advertised in the help (name property is read/write at run time)
>
>If the form is creted as a vcx and instantiated with "oForm = newobject('Myform','MyLib')", however, and I try to do the same thing via "o.MyBtn.name = 'Homer'" - I get a 'property is read only' error!
>
>What the heck is up with that?
>
>TIA,
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.