Click here to Skip to main content
11,798,866 members (42,026 online)
Rate this: bad
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
Edited 20-Jul-11 4:13am
SAKryukov at 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
0 CPallini 465
1 OriginalGriff 378
2 Maciej Los 305
3 Richard MacCutchan 281
4 phil.o 244
0 OriginalGriff 2,270
1 Maciej Los 1,810
2 KrunalRohit 1,496
3 CPallini 1,425
4 Richard MacCutchan 1,109

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 20 Jul 2011
Copyright © CodeProject, 1999-2015
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