setting container property to a different usercontrol

01-20-2005, 03:14 AM

I've created an activex control project with two usercontrols inside,
one public and the other private, and both with controlContainer=true.
From a test standard exe project, I'm trying to display a graphical object
within the private usercontrol in the activex control project.
This is how I proceeded:
1) From the test project, change the graphical object's Container property to the public usercontrol. This works fine.
2) From the public usercontrol, access the graphical object via the
ContainedControls collection and change again its Container property to
the private usercontrol. This raises the following error:
"Runtime error 425 -> invalid object usage."

The code I'm working with (in the public usercontrol):
dim containedControl as object
for each containedControl in userControl.containedControls
if containedControl.key=searchedKey then
set containedControl.container=miPrivateUserControl
end if

Is there any other way to establish the Container property to the private
usercontrol from the public one?


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum