Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys,

I don't know how to add/remove a tabs in/from a tab control in other thread.

I tried but to no avail.

Please help me guys.

Thank You
Posted
Updated 15-Mar-11 22:43pm
v2
Comments
Sergey Alexandrovich Kryukov 16-Mar-11 2:46am    
You did not tag properly. WPF, Forms?... Please do it right now. The Question is too simple, actually, better find the solution yourself. OK, not tag it!
--SA
Dalek Dave 16-Mar-11 4:43am    
Edited for Readability.

1 solution

Try:
C#
private void AddNewTab(string tabName)
    {
    if (InvokeRequired)
        {
        Invoke(new MethodInvoker(delegate{AddNewTab(tabName);}));
        }
    else
        {
        TabPage tp = new TabPage(tabName);
        myTabControl.TabPages.Add(tp);
        }
    }
 
Share this answer
 
Comments
Dalek Dave 16-Mar-11 4:43am    
Spot on.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900