Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How filling a property with an objectreference at design
Message
 
 
À
17/12/1998 05:24:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00168392
Message ID:
00168635
Vues:
23
Thomas,

Let me ask what you are trying to achieve, we may be able to offer other ideas.

You can run into problems with instantiation order here, if the TextBox doesn't exist before the Label.Init() occurs and you attempt to eval(this.BoundObj). You should put the code in a custom method that gets called from the container Init. By that point in time you are assured that both the label and the textbox will exist.

Another approach you can use is to make the label smart enough to find the other control with the same name. Assuming VFP5-6 which creates decent names when you drag/drop fields you can just have a custom method FindMyControl() that searches for another object using substr( this.parent.controls[].Name, 4 )

Another option would be to group these label and the textbox in their own container, but this carries it's own set of problems when trying to subclass.

>I've created a property for my subclassed label thats called 'boundto'. This property shall reference to a textbox. However I don't know how to insert an object-reference into this property at designtime. Is this possible at all or do I have to continue with using macro-substitution?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform