Link to home
Start Free TrialLog in
Avatar of marios
marios

asked on

How can a UserControl create another control at runtime?

I want to instantiate a control at runtine from the code of a UserControl. This is similar to a ComboBox creating a popup list. How can I do this? Do I just call "New" and "Show"? Or do I also have to link the new control with the parent form?

thanks
Avatar of RonaldBiemans
RonaldBiemans

Dim x as new yourusercontrol
'set the properties of your usercontrol and then add them to the form controls

me.controls.add(x)
ASKER CERTIFIED SOLUTION
Avatar of RonaldBiemans
RonaldBiemans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marios

ASKER

I just want to create something like a ComboBox popup list. I will try the code and let you know.

thanks