Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > tab pages
 

tab pages

Iam working onan application in .NET 2.0 , C#.

I created a button on the form.
When this button is pushed I'd like to create 2 tag pages with all the infomation from the form to be placed under both tabs.
I'm not sure how to do this.
dmrs  Friday, September 25, 2009 7:55 PM
Hi dmrs,

If you want to add new tab to the TabControl, you can use the following code.
private void btnAddTab_Click(object sender, EventArgs e)
{
this.tabControl1.TabPages.Add ("New Tab");
}

> I'd like to create 2 tag pages with all the information from the form to be placed under both tabs

This sentence is not clear to me. What information do you want to get from the form?

I am waiting for your reply.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Monday, September 28, 2009 8:30 AM
Thank you for your response..
Its hard for me to describe but I will try...

I have a form witha group of tab pages; for example 1, 2, 3.
On the formI have a button, when I click that button i'd like to create an upper level set of tab pages; for example A, B, C

So the first set of tab pages (1,2,3) are under each of the new tab pages (A,B,C).

Does that make sense? Can you help me with this problem?
Thank You
dmrs  Monday, September 28, 2009 1:11 PM
Hi dmrs,

>So the first set of tab pages (1,2,3) are under each of the new tab pages (A,B,C).

Do you mean Tabpage A will contain 1,2,3 tabpages�controls and the same as B and C? If so, I suggest you to put that set of controls into a User Control. In run time, you can add that user control into the new tabpage. Is that what you’re looking for?

If I misunderstood you, please feel free to tell me. It would be better for me to understand the problem if you can post some screen shot.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Tuesday, September 29, 2009 7:27 AM
Yes, That is what I am looking to do. Can you help?
How do I do what you described?
<put that set of controls into a User Control. In run time, you can add that user control into the new tabpage
dmrs  Tuesday, September 29, 2009 11:37 AM
Hello,

You can take the following step to accomplish this task.
1. Create a User Control named “MyTabControl�for example.
2. Then you will see a blank area in the VS designer, now you can put tabcontrol with tabpages 1,2,3 onto that area and design it.
3. In the form where tab A,B,C is placed, use the following code to add MyTabControl
MyTabControl myTabCtrl = new MyTabControl();
tabA.Controls.Add(myTabCtrl);

myTabCtrl = new MyTabControl();
tabB.Controls.Add(myTabCtrl);

myTabCtrl = new MyTabControl();
tabC.Controls.Add(myTabCtrl);

After that, A,B,C tabpages all contain the set of controls. Do you understand my meaning?

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Wednesday, September 30, 2009 1:44 AM

You can use google to search for other answers

Custom Search

More Threads

• Error when attempting to start terrarium for first time
• How could i use the usercontrol to call the Window Form's Componet.
• RAR
• how many people are using a perticuler url is being used in enteir world
• Destroyed because of error
• Draw in graph?
• I met some questions when installed terrarium,help me .
• Default Publish Setting
• Remote Server Issues
• How to play Terrarium