Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add existing object to form
Message
 
 
To
03/06/2003 22:07:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00795977
Message ID:
00795991
Views:
14
David,

Nope, an already existing object can not be added to some other object. Also an object must be in the containership of a form (AddObject'd to the form) for it to be visible and participate in the UI event loop.

You can "replicate" the object with code like:
thisform.AddObject( "oimage", x.Class )
n = amembers( laPEMs, ox, 0 )

for i = 1 to n
   if ( ! pemstatus( thisform.oImage, laPEMs[i], 1 ) and laPEMs[i] != "NAME" )
      store eval( "ox." + laPEMs[i]) to ("thisform.oImage." + laPEMs[i])
   endif
endfor
>AddObject() creates and adds an object to a form.
>Is there a way to add an existing object instance to a form
>
>eg
>x= createobject('image')
>do form myform
>
>where myform has a command button...
>*** myform.command1.click() ***
>thisform.addxobject('image1', x)
>thisform.image1.visible= .t.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform