How can I add a UserControl Dynamically [resolved]
Hello;
I am trying to add a simple user control to the controls collection at runtime. Is this possible to do? I keep getting the error: invalid progID...I am not sure if I just don't know the right syntax, or maybe this is not possible.
As a side note, this control is embedded into the project and I do not want to compile it as a separate .ocx (not worth the additional deployment burdens)...does it still not generate a progID at runtime that I can reference? I have tried:
VB.UserControl.MultiLineText (control name is MultiLineText)
UserControl.MultiLineText
The root cause of all this mess is wanting to generate the whole form at runtime, but for multiline textboxes, the properties MultiLine and ScrollBars are not available at runtime, so any other ideas for how I can get around this are more than welcome. Thanks.
Last edited by ahara; May 29th, 2004 at 07:47 AM.
"Knowledge is gained when different people look at the same information in different ways"
Firstly, in design mode, copy the usercontrol and paste it again. Visual Basic will ask if you want to create a Control array; click yes. Now, delete the newly made usercontrol. In code, try this now..