Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I create a new object from an object on a form?
Message
From
28/09/2005 11:54:07
 
 
To
28/09/2005 11:33:35
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01054004
Message ID:
01054025
Views:
27
>This may seem strange but I have run into a situation where I want to do this: Can I create a new object on a screen from an object already on the screen? I have a form with a combobox and an editbox (plus labels, buttons, etc). Based on the value selected in the combobox, a second editbox may need to be added to the screen below the first one. The form size will change to accomodate the new editbox. The first editbox was created at design time but will have certain properties modified at runtime. The second editbox needs to have all the same event and method code that is in the first editbox. Of course when the second object gets created the code creating it will change certain properties, etc., such as the name, controlsource, etc. However, the first editbox may have certain properties already set that I want to keep for the new object.
>
>Now, I know that I could create a class for this but this form gets used extensively throughout our system and I only want to do this in a unique instance of the form. Any insight if this can done would be greatly appreciated.

You can use the object's ADDOBJECT() method.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform