Tanmay Sarkar

Tanmay Sarkar

  • NA
  • 1.5k
  • 1m

Multi richtextbox with multi tab

Aug 31 2010 8:28 AM
I get a problem, I dynamicaly build a tab with richtextbox. & want to save it. but i can't save that. Can you help me please?

my code is as follows,

int counter=0;
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TabPage tp = new TabPage();
            this.tabControl1.Controls.Add(tp);
            RichTextBox rt = new RichTextBox();
            rt.Dock = System.Windows.Forms.DockStyle.Fill;
            counter++;
            tp.Name = "New Doc "+Convert.ToString(counter);
            tp.Text = "New Doc " + Convert.ToString(counter);
            tp.Controls.Add(rt);
        }

I think we can get the selected tab like, tabControl1.SelectedTab

but how get the richtextbox to save the content.

Thank you!

Answers (6)