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...

Community
  • 1
  • 1
Miles
  • 5,646
  • 18
  • 62
  • 86

1 Answers1

0

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
  • 61,417
  • 20
  • 137
  • 189