VS 05 - Constructor Attributes and Component Constructor. How are they related?

I had this answer to another post I asked:

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

How should I do it? I don't even know where to start ...

+1


source to share


1 answer


An attribute DesignerAttribute

can be bound to a class Control

or Component

in WinForms to specify a class that implements a constructor for visually editing that type of control or component. For example, a class Form

has DesignerAttribute

which indicates that the named class FormDocumentDesigner

implements its constructor.

Designers allow you to apply special design behaviors in WinForms design in Visual Studio, such as when resizing a list column or in sizing handles for controls. Designers who support adding child controls to an existing control, for example FormDocumentDesigner

, end up getting from ComponentDesigner

.



You can check this with a tool like .NET Reflector.

0


source







All Articles