Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help.. ActiveX Control Problem???

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
I have added a usercontrol to a form as following code, now I would like to unload the usercontrol, I don't want the usercontrol show in the Form any more.

Anyone can help me????


Licenses.Add "Project1.UserControl1"
Set ctlMyTestControl = Form1.Controls.Add("Project1.UserControl1", "ctlTest")
ctlMyTestControl.Visible = True
ctlMyTestControl.Move 1600, 100
 
set visible = false, you may also want to have it on a different form, and unload that form.
 
But I don't want to unload the form, I just want to unload the ActiveX control and I would like to add another ActiveX control to the same form after the previous ActiveX is unload.

How can I do it???
 
You should be able to do an "Unload ctlMyTestControl" to drop only that control from the form.
 


I have tried the "Unload ctlMytestControl", I have a error message " can't load and unload this object".
 
OK, I do know you can add or remove controls from a control array at run time using "Load object(index)" and "Unload object(index)", however the control array must have been created at design time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top