TabPageCollection in UserControl
I have a custom user control which contains a tab control and some other controls. I want to expose the tab control's TabPages property via the user control. For that I have created a property
[ DesignerSerializationVisibility(DesignerSerializat ionVisibility.Hidden), MergableProperty(false), Editor("System.Windows.Forms.Design.TabPageCollectionEdito r, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public TabPageCollection TabPages
{
get
{
return tabControl1.TabPages;
}
}
At design time I can add a tab using the property grid but upon compiling/running they are lost..
Upon inspection I have found that the InitializeComponent() method doesn't contain any lines which should actually be adding the tab i.e
this.customControl1.TabPages.Add(tabPage1);
Is there any work around for this?