Solved

How can a UserControl create another control at runtime?

Posted on 2004-08-06
3
246 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:marios
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 11734392
Dim x as new yourusercontrol
'set the properties of your usercontrol and then add them to the form controls

me.controls.add(x)
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 125 total points
ID: 11734558
Sorry, too hasty in reading your question.

When do you want to create your runtime control, as soon as you instanciate the usercontrol or in a method or property off  the usercontrol

the code will remain the same

dim x as new textbox
x.left = 10
x.top = 10
'etc
me.controls.add(x)
0
 

Author Comment

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

thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question