>Whoops - I just happened to notice it haven't tried it (don't they test their sample code ? or have I just answered my own question ? ). While I have your ear do you know of any good sources of info for creating custom class designers ? e.g. adding ones own custom tabpages to a custom tabcontrol at design time ?
You mean something like this?
using System;
using System.Drawing;
using System.Windows.Forms;
public class myForm : Form
{
private TabControl myTabControl;
private Button cmdAddPage;
public myForm()
{
this.myTabControl = new TabControl();
this.myTabControl.Location = new Point(25, 25);
this.myTabControl.Size = new Size(250, 250);
this.ClientSize = new Size(300, 350);
this.cmdAddPage = new Button();
this.cmdAddPage.Location = new Point(25,280);
this.cmdAddPage.Text = "Add a page";
this.cmdAddPage.Click += delegate { AddTabPage(); };
this.Controls.Add(myTabControl);
this.Controls.Add(cmdAddPage);
}
private void AddTabPage()
{
TabPage pg = new TabPage( );
myTabControl.TabPages.Add( pg );
pg.Text = String.Format("Tab page#{0}",myTabControl.TabPages.Count);
Label lbl = new Label();
TextBox tb = new TextBox();
pg.Controls.AddRange( new Control[] {lbl, tb});
lbl.Text = ((Control)lbl).Parent.Text;
lbl.Location = new Point(10,10);
lbl.Size = new Size(100,20);
tb.Location = new Point(110,10);
tb.Size = new Size(100,20);
}
static void Main()
{
Application.EnableVisualStyles() ;
Application.Run(new myForm());
}
}
Oh you were talking about design time. I'm not good with designers and more code oriented.
Cetin