0

Hi,

I'm currently stuck, at this problem. I've created a tab control and make it add a new richtextbox each time a tab is added, but my problem is I can't figure out how to get the .Text part of that richtext box in that tab...

here is my code to add the tabs:

private void newTab_Click(object sender, EventArgs e)
{
	tabControl11.TabPages.Add("new file");
	tabControl11.SelectTab(tabControl1.TabCount - 1);
	RichTextBox rtb = new RichTextBox();
	rtb.Name = "tabControl1Text";
	rtb.AcceptsTab = true;
	rtb.DetectUrls = false;
	rtb.WordWrap = false;
	rtb.Dock = DockStyle.Fill;
	rtb.Text = "testing";
	tabControl1.SelectedTab.Controls.Add(rtb);
}

I've tried tabControl1Text.Text but won't get anything but an error. Please guide me in the right direction, Thanks!!

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by kashn
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.