Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Addproperty causing an error
Message
De
01/12/2003 04:21:33
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00854147
Message ID:
00854609
Vues:
21
Hi Gerard,
>Hi Agnes.
>
>oObject is a control on the form, say a Text Box.
>The Control Source for the Text Box(Set up on the properties screen option)
>is eqaul to : Thisform.objmemvar.MyField

I would advise to do CONTROLSOURCE in a form like
.CONTROLSOURCE = 'THIS.PARENT. ... objmemvar.MyField'

because the reference from THIS is better then THISFORM (THISFORM changes with the form that has focus).

HTH

Agnes
>
>(I have the following code elsewhwre )
> Sele Myfile
> Scatter Name ThisForm.Objmemvar
> (This create a objMemvar.Field1,ObjMemvar.Field2,ObjMemVar.field3 etc for each field in the file)
>
>Regards,
>
>Gerard
>
>
>
>
>>Gerard,
>>
>>I do not understand the part with controlsource. Do you mean oobject points to Thisform.objMemVar.Myfield? Like
>>
>>oobject = Thisform.objMemVar.Myfield
>>
>> or is Thisform.objMemVar.Myfield the controlsource of oobject
>>
>>oobject.controlsource = "Thisform.objMemVar.Myfield"
>>
>>?
>>
>>Is myfield/oobject created with scatter to name? (E.g. what class is MyField/oobject)
>>
>>could you please give me the error number and your VFP version?
>>
>>>Hi.
>>>I have a comand as follows :
>>>oObject.Addproperty('MyNewProperty')
>>>
>>>The control Source of OObject happens to be :
>>> Thisform.objMemVar.Myfield
>>> (From a Scatter Name command)
>>>
>>>When the Addproperty is being run, the ObjMemVar.Myfield does not exist and the Addproperty comes up with an error message. If I remove thew control Source, or change it to a property of the form that does exist when the Addproperty is being run, its ok.
>>>
>>>
>>>It looks like the AddProperty does some sort of validation on the object and looks for a valid ControlSource property.
>>>Unfortunately, this is not created until later on.
>>>
>>>Has anybody come across this and know a way around it ?
>>>
>>>Regards,
>>>
>>>Gerard
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform