Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How filling a property with an objectreference at design
Message
De
17/12/1998 08:44:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/12/1998 05:24:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00168392
Message ID:
00168445
Vues:
28
>Hi all,
>
>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?
>
>Thanks in advance

I think you would get into trouble if you use "boundto" as a property name. Although labels don't have a boundto property I think (might not be - not tested) using "boundto" (or any default name of VFP) as name will fool VFP. Instead first change it to something else ie:myBoundTo.
Setting the obj ref at design time directly would be problematic. Instead just write textbox's ref hierarchy as if you would write in code window. ie: write thisform.myTxt directly in PEM sheet. In class, label's init method add the line :
this.myBoundTo = eval(this.myBoundTo)
So label.myBoundTo holds obj ref now and you can use it freely. ie:
thisform.myTxt.value = "Hello"
thisform.myLabel.myBoundTo.value = "There" && thisform.myTxt.value
PS: Do not forget to set myBoundTo to .NULL. before form.release or form won't release because of hanging obj var references. You may do it in your "close" button :
thisform.setall("myBoundTo",.NULL.,"myLabel").
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform