I created my own Tabcontrol class, derived from UserControl, beacause I don't like the design of the exisiting Tabcontrol class. It works fine, but now I want to add design-time support to the control and I have no idea how to start. I've read some tutorials but none of them explains how create a Tabcontrol. Thanks for help ;)
Edit:
public class TabListDesigner : ParentControlDesigner
{
private DesignerVerb addVerb;
private DesignerVerb removeVerb;
private DesignerVerbCollection verbs;
protected TabList TabListControl { get { return this.Control as TabList; } }
public override DesignerVerbCollection Verbs
{
get
{
if (verbs == null)
{
verbs = new DesignerVerbCollection();
addVerb = new DesignerVerb("Add TabListPage", this.AddVerbHandler) { Description = "Add a new TabListPage to the parent control." };
removeVerb = new DesignerVerb("Remove TabListPage", this.RemoveVerbHandler) { Description = "Remove the currently selected TabListPage from the parent control." };
verbs.Add(addVerb);
verbs.Add(removeVerb);
}
return verbs;
}
}
private void AddVerbHandler(object sender, EventArgs e)
{
this.TabListControl.Add();
}
private void RemoveVerbHandler(object sender, EventArgs e)
{
//this.RemoveSelectedTabListPage();
}
public override void InitializeNewComponent(IDictionary defaultValues)
{
base.InitializeNewComponent(defaultValues);
this.TabListControl.Add();
this.TabListControl.Add();
}
}
So this is what I did, but it doesn't work. The TabListControl.Add()-method works (I tested it on runtime, but I want the designtime support)
I want to be able to: - the control should be initialized with 2 TabPages on design-time - add/remove TabPages on design-time - switch TabPages on design-time - add Controls to the different TabPages on design-time