473,670 Members | 2,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create TabPages at runtime (with controls)

Luc
Hi,

I have a TabControl and, at runtime, I need to add some tabpages. The
problem is that each tabpage is similar to the others and contains several
controls.

If I do TabControl.TabP ages.Add(MyTabP age), a new BLANK tabpage is added.
How can I add in few statements a new tabpage as well as its controls
(textboxes, labels, etc.)? The first tabpage (that I create at design time)
is the "template" to be used for the other tabpages. Is there a way at
runtime to duplicate the first tabpage and create new tabpages based on this
one (including controls)? Also: how can I reference (at runtime) the newly
created tabpages and their controls?

Thanks,

Luc

Nov 20 '05 #1
1 2726
"Luc" <no****@nospam. com> schrieb

I have a TabControl and, at runtime, I need to add some tabpages.
The problem is that each tabpage is similar to the others and
contains several controls.

If I do TabControl.TabP ages.Add(MyTabP age), a new BLANK tabpage is
added. How can I add in few statements a new tabpage as well as its
controls (textboxes, labels, etc.)? The first tabpage (that I create
at design time) is the "template" to be used for the other tabpages.
Is there a way at runtime to duplicate the first tabpage and create
new tabpages based on this one (including controls)? Also: how can I
reference (at runtime) the newly created tabpages and their
controls?


You could create a Usercontrol and put it on the first TabPage. Then, at
runtime, create new instances of the Tabpage and the Usercontrol.

Or, derive your own class from the Tabpage class, but you won't be able to
use a designer to design it.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
2731
by: nobody | last post by:
hello everybody, is there a way of creating an array with help of a function that would accept the name of this array as a parameter and then create global Array type variable of that name? so that for example the following code would work as well in browsers as under Windows Scripting Host: str = "tableA";
1
1965
by: SAN CAZIANO | last post by:
how can i create a runtime table and define a new field to allow null value and set the rquired to true or false ???
3
2732
by: cql90 | last post by:
Hi all PRO, I don't know how to create the MSAccess database in the runtime with C#, Are there any body know how to do this? I am pretty sure that all of you know how to do it, except me :( . Thanks you so much in advance, I am deeply appreciated for your help. Take care and have a good one... Kate
1
1400
by: wpy | last post by:
Hi, Does anybody know how to create multiple control with same ID or name in asp.net and request the controls's value in array form? For example the vb control can have same same but with different index. Thanks.
2
1670
by: Scott Kelley | last post by:
I have a control inside of an asp:Table control. Once I place it in there, I can't seem to edit it any more (Double click to add events, drag to reposition, etc...). If I use an HTML table, no problem. Is there any way around this. I have tried grid layout as well as flow layout. Sample of the code. <asp:Table id="Table1" runat="server" Width="512px" Height="344px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"...
4
3161
by: Rainer Queck | last post by:
Hi NG, I am looking for a good way to dynamically generate a bunch of TabPages. I have a list of more or less identical object. For each of these objects I need a user interface. My thought is, to provide a TabPage for every object with controls on it to interact with them. How can that be achieved dynamically. The only way I can think of to do this is to prepare the max needed TabPages
0
1026
by: Merdaad | last post by:
Hi, I am using ASP.NET 2.0 with C#. On a page I have a few (static) textboxes that get populated from database and then I create other textboxes during runtime using the folloiwng steps: 1. I add a TableRow(TR) to an existing table using HtmlTableRow 2. I add TableCells(TD) to the above TR using HtmlTableCell 3. I add TextBoxes to the TDs using using TextBox Then I start entering into the runtime Textboxes, when done, I press Enter...
7
1720
by: =?Utf-8?B?YW5kZXJzY2g=?= | last post by:
Hi It is possible to create an .exe file at runtime with .NET 2.0? I would like to create a .exe that should include: - an encrypted file - a simple winform to decrypt the included encrypted file (already compiled as .exe)
1
1297
by: kollasaeta | last post by:
Hi I have this table which I create on runtime with some rows from my database. What I want to do is when I create the table I want to create a button/ linkbutton/link or something beside each entry from the database and when the user clicks on this button i want to remove the database entry from the table. So I guess my question is, how do I create a button with an onClick event on runtime that knows what row it belong to.. So i can...
0
8468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2041
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.