Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi !
first sorry for my bad english.
I'm under .Net framewok 3.5 and Winform.
I try to make a custom SplitContainer with multiples child panel. No problems with that.I have created a custom Designer for custom verbs, and now, I want to add default childs panels.So when I drag my custom control on the design surface, he must have 3 default childs, and my problem is here.I tried different things.

-Add the childs in the constructor of my control.This works, but the childs are not selectables in the Form or visibles in "Document outline".

-Add the childs in the override of function "Initialize" of the Designer with a Transaction. Works fine, default childs are created and are selectables in the Form, and are visible in the "Document outline". But I have a strange behavior.
I have a custom SplitContainer with 3 default childs.If I save the project, close the IDE and re-open it, now, I have 6 default childs in my control !!
But another strange thing is that if I close the IDE (with my 6 childs) and re-open it, I have 6 childs and not 12 or 9 !!

I think I can understand why they are recreated each time, but the real question is, what is the best way to add default childs containers to a UserControl the same way as a tabControl or a standard SplitPanel? Here is my classes structure:

MultiSplitterContainer (inherits FlowLayoutPanel)
MultiSplitterPanel (inherits ContainerControl)
MultiSplitterContainer_Designer (inherits ParentControlDesigner)
MultiSplitterPanel_Designer (inherits ScrollableControlDesigner)

thanks in advance for your help (C# or VB, I can read both)!
Posted
Updated 20-Jul-11 4:13am
v3
Comments
Sergey Alexandrovich Kryukov 19-Jul-11 23:21pm    
What "user-controls"? Please, platform, language, UI library. Tag it all.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900