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
  • 250
    posted

    The Infragistics docs on UltraTabPageControl says that instances of these classes are created automatically for each UltraTab created. This might be why you are getting double the number of tabs. You probably can add your controls directly without instantiating a UltraTabPageControl:

    ultraTab1.TabPage.Controls.Add(control);

    Indika

Children