Click here to Skip to main content
Rate this: bad
good
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 12:35pm
Edited 20-Jul-11 5:13am
v3
Comments
SAKryukov at 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)

  Print Answers RSS
0 OriginalGriff 280
1 Maciej Los 280
2 BillWoodruff 240
3 Afzaal Ahmad Zeeshan 239
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 20 Jul 2011
Copyright © CodeProject, 1999-2014
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