Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Two tabs are getting added when I try to add one Tab in TabControl
posted

I am using Infragistics 7.3 version UltraTabControl.

I have written the following code to add tabs and  controls to the tabs at run-time. I am calling addTabs() function 4 times, this means I have to get 4 tabs added to tab control. But 8 tabs are get added to tab control.

public Form1()

{

InitializeComponent();

TextBox tx1 = new TextBox();

TextBox tx2 = new TextBox();

TextBox tx3 = new TextBox();TextBox tx4 = new TextBox();

addTab(tx1);

addTab(tx2);

addTab(tx3);

addTab(tx4);

 

}

private void addTab(Control control)

{

UltraTab tab=new UltraTab();UltraTabPageControl page=new UltraTabPageControl();

page.Controls.Add(control);

this.ultraTabControl1.Controls.Add(page);

tab.TabPage=page;

this.ultraTabControl1.Tabs.Add(tab);

}

 Please Reply,

Thanks in advance.

 

 

Parents
No Data
Reply
  • 135
    posted

     I see that you add the UltraTabPageControl to ultraTabControl1 and then add the UltraTab control to ultraTabControl1 again. Try removing the following line.

    this.ultraTabControl1.Controls.Add(page); 

Children