Hi guys,

How I could get the controls of tab controls, here's a sample code

public void AddTabPage() {

            tabCounter = tab.TabCount;
            
            if (tabCounter == 0)
            {
                TabPage page = new TabPage("New Doc " + 1);
                //CurrentTabPageName = "New Doc " + 1;
               [U][U] RichTextBox txt = new RichTextBox();[/U][/U]
                txt.Dock = DockStyle.Fill;                
                page.Controls.Add(txt);
                tab.TabPages.Add(page);
                tabCounter++;
            }
            else {
                tabCounter++;
                TabPage page = new TabPage("New Doc " + tabCounter);
               // CurrentTabPageName = "New Doc " + tabCounter;
         [U][U]RichTextBox txt = new RichTextBox();[/U][/U]
                txt.Dock = DockStyle.Fill;
                page.Controls.Add(txt);
                tab.TabPages.Add(page);                
            }
        }

here's I created richTextBox object on the runtime, how I could access this object from tabcontrol???

Find by a key,

TabPage page = new TabPage("New Doc " + 1);
//CurrentTabPageName = "New Doc " + 1;
RichTextBox txt = new RichTextBox();
txt.Name="Item1";
txt.Dock = DockStyle.Fill;                
page.Controls.Add(txt);
tab.TabPages.Add(page);
Control  []t = tabControl1.Controls.Find("Item1", true);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.