【发布时间】:2010-10-30 12:38:17
【问题描述】:
我有一个在 C# 中创建的组件,该组件以前使用默认构造函数,但现在我希望它的父窗体通过传递对自身的引用来创建对象(在设计器中)。
换句话说,而不是designer.cs中的以下内容:
this.componentInstance = new MyControls.MyComponent();
我想指示表单设计者创建以下内容:
this.componentInstance = new MyControls.MyComponent(this);
是否有可能实现这一点(最好通过一些属性/注释或其他东西)?
【问题讨论】:
标签: c# .net visual-studio attributes form-designer