Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How filling a property with an objectreference at design
Message
From
17/12/1998 08:44:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/12/1998 05:24:49
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00168392
Message ID:
00168445
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform