views:

347

answers:

1

I had this answer on another post I asked:

"I believe the VS designer does it [components of a menustrip/statusstrip] by getting an instance of the control's designer (see the Designer attribute), and, if the designer is a ComponentDesigner, getting the AssociatedComponents property."

How do I do this? I'm not even sure where to begin...

A: 

The DesignerAttribute attribute can be attached to a Control or Component class in WinForms to indicate the class that implements a designer for visually editing that type of control or component. For example, the Form class has a DesignerAttribute that indicates a class called FormDocumentDesigner implements its designer.

Designers allow special design-time behavior to be applied in the WinForms designer in Visual Studio such as list view column resizing or the sizing handles on controls. Designers that support the addition of child controls to an existing control, such as FormDocumentDesigner are ultimately derived from ComponentDesigner.

You can check this out by using a tool like .NET Reflector.

Jeff Yates
If the designer is in another DLL, how do you install the designer DLL in VS?
Peter Morris
I expect that the designer DLL would need to be side-by-side with the DLL that has the type being designed or possibly in the GAC.
Jeff Yates