?
Solved

how can i generate tab pages dynamically through coding in my C#.net window application ??

Posted on 2011-02-23
6
Medium Priority
?
254 Views
Last Modified: 2012-06-21
i want to generate tab pages dynamically through coding in my tabcontrol , but how can i do this ?
here i attach one snapshot in which 3 tabpages i created statically ,but i want to do it dynamically , but how can i do this ??



23-02-2011-6-22-18-PM.jpg
0
Comment
Question by:Parth48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34960359
YourTabControl.TabPages.Add("A dynamic tab");

Open in new window

0
 
LVL 1

Accepted Solution

by:
milanjaric earned 2000 total points
ID: 34960560
tabControl.SuspendLayout();
// docking panel
Panel panel = new Panel();
panel.Dock = DockStyle.Fill;
panel.Controls.Add(new SomeUserControl());
// new Tab
TabPage tabPage = new TabPage("Tab title");
            
// add controls to their parents
tabPage.Controls.Add(panel);
tabControl.TabPages.Add(tabPage);

tabControl1.ResumeLayout();

Open in new window

0
 

Author Comment

by:Parth48
ID: 34967673
hi @milanjaric: u r right ...

but in your coding

panel.Controls.Add(new SomeUserControl());

where i can add someusercontrol , or i have to create user control for it ??
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Parth48
ID: 34968837
how can i dynamically add usecontrols to created tabpage ???

give me some suggestions ....
0
 
LVL 1

Expert Comment

by:milanjaric
ID: 34969049
where i can add someusercontrol , or i have to create user control for it ??
The answer is YES you need to create one if you did not have already

how can i dynamically add usecontrols to created tabpage ???
Look at my example above.
0
 

Author Comment

by:Parth48
ID: 34977425
hi @milanjaric: Thanks ...

it's working ...
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question