Solved

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

Posted on 2011-02-23
6
245 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
  • 3
  • 2
6 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
Comment Utility
YourTabControl.TabPages.Add("A dynamic tab");

Open in new window

0
 
LVL 1

Accepted Solution

by:
milanjaric earned 500 total points
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Parth48
Comment Utility
how can i dynamically add usecontrols to created tabpage ???

give me some suggestions ....
0
 
LVL 1

Expert Comment

by:milanjaric
Comment Utility
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
Comment Utility
hi @milanjaric: Thanks ...

it's working ...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now