I have an object created with CREATEOBJECT() and I want to set him a parent object.
From msdn :
When you create an object with the CREATEOBJECT( ) function, the object is scoped to a property of the class or a variable in the method that calls this function. The parent property of the object is undefined.
With .addobject() it’s impossible because this method creates object , but I have already a created object .
The question is : how can I create many objects (commandbuttons for example) which will have parent objects ? Thanks in advance .
You can’t add an existing object and get a parent/child relationship. You can add an object reference to the existing object and while doing so, set a pseudo-parent. However, that won’t give you a visible presence. That is, it’s great for objects that are doing processing, but not for controls.
So why do you have a button that isn’t already inside a container or on a form? It seems to me that there’s a fundamental misunderstanding here.