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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TabPageExt dynamic creation.

Thread ID:

Created:

Updated:

Platform:

Replies:

8356 Nov 3,2003 05:27 PM UTC Nov 6,2003 12:24 PM UTC WinForms 6
loading
Tags: Tools
Odis Wooten
Asked On November 3, 2003 05:27 PM UTC

In the AdvancedTabbedMDI project the CustomerInfoForm is created at runtime and added or remove to/from the TabbedMDI Manager (A new tab appears in the tabcontrol). How can I do the same thing with the TabControlExt to add a form as a tab?

Arun Srinivasan [Syncfusion]
Replied On November 3, 2003 08:25 PM UTC

Hi Otis, Kindly take a look at the XPTabs sample located in the Syncfusion\Essential Suite\Tools\samples\Tabs Package\XPTabs directory. Take a look at the code in Form2_InitProgramatically() which demonstrates how you can create and add tabs using code. Modify the Application's Run() to: Application.Run(new Form2_InitProgramatically()); Does this take care of what you are looking for? Regards, Arun

Odis Wooten
Replied On November 4, 2003 12:50 PM UTC

Thanks for your prompt reply. The example using Form2_InitProgramatically() is not what I want to do. I want to be able to create a form using VS.NET designer and then use that form as a tabpage. I don’t want to have to add the control on the tabpage programmatically. The example AdvancedTabbedMDI does this with a TabbedMDI. I'm need to place this same form as N number of TabPageExt on the TabControlExt.

Arun Srinivasan [Syncfusion]
Replied On November 5, 2003 12:02 PM UTC

Hi Odis Here is a code snippet that does what you are looking for: //Form2 Form2 frm2 = new Form2(); frm2.TopLevel = false; //New Tab TabPageExt newtab = newTabPageExt("test"); this.tabControlExt1.Controls.Add(newtab); //Set Form2's parent to be the new tab frm2.Parent = newtab; frm2.Visible = true; frm2.Dock = DockStyle.Fill; Hope this takes care of this issue. Regards Arun

Odis Wooten
Replied On November 5, 2003 10:36 PM UTC

Arun I’m having problems with the code snippet. What class is Form2. The windows Form class doesn’t have the properties you are using Frm2.TopLevel = false; //Set Form2's parent to be the new tab frm2.Parent = newtab; frm2.Visible = true; frm2.Dock = DockStyle.Fill; Just try to add a simple Form to the XPTab example and then add it to the TabControlExt as a new page. Odis

Arun Srinivasan [Syncfusion]
Replied On November 6, 2003 11:07 AM UTC

Hi Odis, I am uploading a small sample that does what you are looking for. Form1 has a TabControlAdv with 2 tabs. Form2 is another form in the project. When you click the "Create New Tab and add Form 2" button, a new Tab called "FORM_2" is added to the TabControlAdv with Form2 attached to this Tab. Kindly take a look at the underlying code in the button's click event. Regards Arun

Odis Wooten
Replied On November 6, 2003 12:24 PM UTC

Arun Thanks. It works like a charm. Oids

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;