Click here to Skip to main content
15,897,182 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have made one user control (component) in windows forms..In that user control i had taken one panel and inside that panel takes some controls like button,label,checkbox etc.... and build it... and then take reference of that user control in another executable project...(means adding my usercontrol in toolbox of .net framework)...then drag and drop that my user control on to the form.. now what i want.... when i drop my user control on to the form..i have to add another control(button,label,pcturebox etc) from toolbox to my user control(design time).....and also add controls from my user control to the form at runtime....

How can i do tht?
Posted

Adding controls to your user control not too sure, I don't think its possible.
To dynamically show controls from your user control, have properties to show / hide the control and set the visibility at instance level.
 
Share this answer
 
Its possible you can try with tablelayout panel at design time .In runtime can try tableLayoutPanel1.SetRow() this function to add coontrol dynamically.But in design time definety can.If you have an option to use any third party control can use Component one sizer control.
 
Share this answer
 
Comments
[no name] 5-Dec-11 0:35am    
Hi Devopriyo,

will u send me the exact link and description of Component one sizer control....
Devopriyo Seal 8-Dec-11 0:30am    
You can find all documentation for inplementing sizer control.please follow the link below:-
http://www.componentone.com/SuperProducts/SizerWinForms/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900