.NETGURU
Access the ComponentTray
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.windowsforms.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Joris Laperre (VIP)
Hi,

I'm writing an add-in that adds controls to a form at design time. I got
this working for visible controls on the form by getting an IDesignerHost for
the form, and adding to the Controls collection of the RootComponent, but
this doesn't work for components in the ComponentTray (I want to add an
ImageList). I suspect I need to call the Add method of the Controls
collection on the ComponentTray, but I don't know how to get to the
ComponentTray object for a Form or UserControl. Any ideas ?

Thanks in advance.

Cheers,
Joris
Reply to this message...
 
    
Iulian (VIP)
You actually need to use the CreateComponent() method of the IDesignerHost
that will automatically add the component where it needs to be added, e.g. if
it is a component that goes in the tray you will see it there. Similar to
remove one use DestroyComponent().

regards,
Iulian
http://www.olvio.com/

"Joris Laperre" wrote:

[Original message clipped]

Reply to this message...
 
    
Joris Laperre (VIP)
Hi Iulian,

That's exactly what I need. Thanks for your help.

Cheers,
Joris

"Iulian" wrote:

[Original message clipped]

Reply to this message...
 
 
System.ComponentModel.Design.IDesignerHost
System.Web.UI.UserControl
System.Windows.Forms.Design.ComponentTray
System.Windows.Forms.ImageList
System.Windows.Forms.UserControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification