We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Windows Form place into Tabcontrol

Hi.

how to place form into TabPageAdv using c#
this my script but not working corectly.

            PUK.PUKChart form = new PUK.PUKChart();
            form.TopLevel = false;
            Syncfusion.Windows.Forms.Tools.TabPageAdv newtab = new Syncfusion.Windows.Forms.Tools.TabPageExt(form.Text.ToString());
            this.tabData.Controls.Add(form);
            form.Parent = newtab;
            form.Visible = true;

but form place intab without any control on it.
thank.

1 Reply

SK Senthil Kumaran Rajan Syncfusion Team June 16, 2017 12:53 PM UTC

Hi Jaka, 
 
Thanks for contacting Syncfusion Support. 
 
In the provided code example, the form has been directly added in the TabControlAdv. But we have to add the Form inside the TabPageAdv and add the TabPageAdv inside the TabControlAdv, by using the below code example. Please use the below code example and let us know whether the reported behavior has been resolved? 
 
Code Example[C#]: 
 
Form2 form = new Form2(); 
form.TopLevel = false; 
Syncfusion.Windows.Forms.Tools.TabPageAdv newtab = new Syncfusion.Windows.Forms.Tools.TabPageExt(form.Text.ToString()); 
//Add the TabPageAdv in the TabControlAdv 
this.tabControlAdv1.TabPages.Add(newtab); 
//Add the Form inside the TabPageAdv. 
form.Parent = newtab; 
form.Visible = true; 
 
 
We have prepared the sample for your reference and this can be downloaded from the below location. 
 
 
Also, refer the below screenshot for further reference. 
 
 
 
Regards, 
Senthil 


Loader.
Up arrow icon