?
Solved

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

Posted on 2011-02-23
6
Medium Priority
?
259 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 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