Soo...我正在制作一个类似 Windows 更新“面板”的控件。
直到“容器”部分一切都很好。
我想要做的是允许设计者将控件放置在我的控件内的 Panel
中。
(面板的变量保存在我的控件的类中以及控件本身的内部。)
如何绕过这个?
作为参考,您可能想要尝试这个 AeroWizard Control,它可以执行此操作很好。
(是的,我看过它,除了定制设计师之外没有找到任何线索!)
作为旁注,我宁愿不创建一个复杂的设计师类......
Soo... I am making a control like the Windows Update "panels".
Everything's fine up to the "container" part.
What I want to do is to allow the designer to place controls in a Panel
which is inside my control.
(The panel's variable is held in my control's class and inside the control itself.)
How do I bypass this?
As a reference, you might want to try out this AeroWizard Control, which does this pretty well.
(Yes, I have looked at it and didn't find a clue but custom designers!)
As a side note, I'd rather not make a complicated designer class...
发布评论
评论(1)
如果您不想创建自定义设计器类,则应将控件实现为 模板化自定义控件,最好继承自CompositeControl。如果没有自定义设计器类,似乎没有办法在 Windows 窗体中执行相同的操作。然而,这样的设计器有一个很好的、简短的、有效的示例此处。
If you don't want to create a custom designer class, you should implement your control as a templated custom control, preferably inheriting from CompositeControl.There doesn't seem to be a way to do the same in Windows Forms without a custom designer class. However, there's a nice, short, working example of such a designer here.