Code:
private void newTab(object sender, EventArgs e)
{
if (rtb != null)
{
tabPage1 = new TabPage("Untitled");
tabPage1.Controls.Add(rtb);
tabPage1.AutoScroll = true;
rtb.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabs.TabPages.Add(tabPage1);
rtb.Multiline = true;
rtb.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth;
rtb.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
tabs.SelectedTab = tabPage1;
}
}