Make a richTextBox infinitely generate

  • Thread starter Thread starter MojiPPT
  • Start date Start date
M

MojiPPT

Guest
I have this code but it only generates one `rtb` and moves it around to the most recently made tab page. How could I make it generate infinitely and have one on each newly made page?

public void PropTheThings()
{
// add a new tab
TabPage tabPage = new TabPage("Tab");
tabControl1.TabPages.Add(tabPage);

// retrieve amount of pages
int tc = tabControl1.TabCount;

//retrieve selected tab
var seltab = tabControl1.SelectedTab;

// modify how rtb looks
rtb.Name = "rtb" + tc;
rtb.BackColor = Color.White;
rtb.BorderStyle = BorderStyle.None;
rtb.Font = new Font("Microsoft JhengHei UI Light", 9.55F);
rtb.ForeColor = Color.FromArgb(6,6,11);
rtb.Location = new Point(0, 1);
rtb.Size = new Size(520, 227);
rtb.TabIndex = 1;
rtb.Text = "Placeholder Text";

//place component
tabControl1.SelectTab(tabPage);
tabPage.Controls.Add(rtb);
}

Continue reading...
 
Back
Top