【发布时间】:2010-09-22 21:30:47
【问题描述】:
我在another post 上得到了这个答案,我问:
“我相信 VS 设计器通过获取控件设计器的实例(请参阅 Designer 属性)来实现 [菜单条/状态条的组件],并且,如果设计器是 ComponentDesigner,则获取 AssociatedComponents 属性。”
我该怎么做?我什至不知道从哪里开始......
【问题讨论】:
标签: c# .net-2.0 attributes components
我在another post 上得到了这个答案,我问:
“我相信 VS 设计器通过获取控件设计器的实例(请参阅 Designer 属性)来实现 [菜单条/状态条的组件],并且,如果设计器是 ComponentDesigner,则获取 AssociatedComponents 属性。”
我该怎么做?我什至不知道从哪里开始......
【问题讨论】:
标签: c# .net-2.0 attributes components
DesignerAttribute 属性可以附加到 WinForms 中的 Control 或 Component 类,以指示实现用于可视化编辑该类型控件或组件的设计器的类。例如,Form 类有一个 DesignerAttribute,表示名为 FormDocumentDesigner 的类实现了它的设计器。
设计器允许在 Visual Studio 的 WinForms 设计器中应用特殊的设计时行为,例如调整列表视图列的大小或控件上的大小调整句柄。支持将子控件添加到现有控件的设计器,例如FormDocumentDesigner,最终派生自ComponentDesigner。
您可以使用 .NET Reflector 之类的工具进行检查。
【讨论】: