Click here to Skip to main content
13,054,615 members (59,697 online)
Rate this:
Please Sign up or sign in to vote.
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 19-Jul-11 11:35am
Updated 20-Jul-11 4:13am
SAKryukov 19-Jul-11 23:21pm
What "user-controls"? Please, platform, language, UI library. Tag it all.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 20 Jul 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100