>>>
>>>No, Fabio, I don't believe this is a bug.
>>>Objects instaniate (initialize) from inner most object to the outter most,
>>>in this case the form.
>>>Calling OBJTOCLIENT() before the form has been initialized and shown is bound to produce inaccurate results.
>>>>>>
>>>I was sure that someone would have written this thing.
>>>
>>Fabio,
>>
>>If so, then why post it? If the behavior of the way VFP creates objects was changed to fit your expectations, then we'd have a form, then one-by-one the controls like so many Internet pop-up ads.
>
>George,
>
>I read Fabio's retort as 'if that was the case, I'm sure it would have been documented'.
>
>Of course, I could be wrong.
Jim,
If you create the command button first in the command window, then issue an OBJTOCLIENT() call, how can the function return a valid value? No form exists yet. It's basically the same thing when the form loads. None of its properties have been initialized, so how is OBJTOCLIENT() in an object's events that occur this supposed to return a value that's meaningful?
Certainly, it may be helpful to some to document this, but a bit of common sense can give you a meaningful answer as well.
George
Ubi caritas et amor, deus ibi est