Hi !
I would like to create a UserControl that act as a « Collapsible Panel ».
So I have a UserControl with two panels : a "Header panel" at the top, and a
"Container Area Panel" docked to fill the remaining client area of the
UserControl.
The "Header panel" is for Text, Icon,.
The "Container Area Panel" is to host all the Control dragged from the V.S.
toolbox.
How can I tell the designer that the "Container Area Panel" ONLY should
accept controls (dropped from the toolbox) ?
Actually my "Container Area Panel" has public modifiers.
I tried with that statement just above the declaration of my
CollapsiblePane l Class
[Designer(typeof (CollapsiblePan elDesigner))]
And I have made this class:
public class CollapsiblePane lDesigner : ParentControlDe signer
{
public override void Initialize(Syst em.ComponentMod el.IComponent
component)
{
base.Initialize (component);
CollapsiblePane l TmpCollapsibleP anel = component as CollapsiblePane l;
EnableDesignMod e(TmpCollapsibl ePanel.ClientPa nel,
TmpCollapsibleP anel.ClientPane l.Name);
}
}
But this doesn't work .. I can drop controls on my CollapsiblePane l, but
designer allow to drop them also on the "Header Panel" (It shouldn't) . And
the Designer "forget" to add the controls to the "Container Area Panel" at
run time : in the InitializeCompo nent() the control on the CollapsiblePane l
are never added to the control (this line is missing [not generated]:
this.Collapsibl ePanel1.Pan_Con tainer.Controls .Add(Textbox1); )
Does anybody have an idea on what I'm missing ??
Thanks for any help or comments,
Steph.