Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddProperty for object
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00362650
Message ID:
00362671
Views:
19
Brien,
PMFJI, but I'm not sure I understand your problem.

When you use AddProperty, the control is not added to the context of the form container. When the form is displayed, only objects contained in the form can be displayed. AddObject adds objects to the form's Objects collection.

Once you add the form or form class to the form, you can access and change any property you want. The code below would look like:
gofrm = create("form")
gofrm.AddObject("textboxname","textbox")
gofrm.textboxname.Visible = .T.
gofrm.show(1)
One other thing. My tests of this show the textbox being added at position 0,0. You might want to work with the positioning *s*.

>Hi Barb,
>
>I did a search through the old messages on AddObject, but didn't find the thread. Is it possible to create the object and inherit all the properties & methods from the reference?
>
>>Hi Brien,
>>
>>This was in a thread a few days ago -- You need to use "AddObject()" to place the textbox on the form.
>>
>>HTH
>>Barbara
>>
>>>Code:
>>>
>>>gofrm = create("form")
>>>gotxt = create("textbox")
>>>gotxt.visible = .t.
>>>gofrm.addproperty("txt1",gotxt)
>>>gofrm.show(1)
>>>
>>>Who can tell me why the textbox in this form is not visible?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform