Vercas
Vercas

Reputation: 9141

Share a (container)control from a (custom)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...

Upvotes: 1

Views: 450

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262919

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.

Upvotes: 1

Related Questions