473,794 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net tabpage copying dynamic

Hi all,

I have an app that contains a tab control with a tabpage on it. As
part of the interface, the user keys in a field that basically
identifies how many instances of these tabpages to have. So my basic
question is how can I make copy of a tabpage dynamically so when the
user says they want 3 occurrences, I add two new pages with all the
same controls dynamically. The new pages should have exactly all the
same controls as the original page, but the values within the fields
will be populated differently based on my database.

Thanks,
Mark

Jan 20 '06 #1
7 4257
Marfi,

The tabpage in version 1x has some unwanted behaviour therefore I show
everybody almost forever with a tabpage this link.

http://dotnetrix.co.uk/tabcontrols.html

It seems simple that you only need to copy all controls from tabpage1 to
tabpage2 however that is not true because that creates a shallow copy. (It
are the same controls)

Probably the best way to go is to create from your TabPage your own
controlclass by inheriting the TabPage class. Fill this and use that on your
tabpage.

http://msdn.microsoft.com/library/de...classtopic.asp

I would try to inherit tabpage instead of usercontrol

I hope this helps,

Cor
Jan 20 '06 #2
Thanks. You wouldn't by any chance have a small example of doing
something like this would you ?

Jan 20 '06 #3
I suppose one way I could do it is to impose a maximum for the user
(shouldn't be a problem for the user) and create that many on the form,
but hide/show them as needed. If I did this, then the controls would
have to have different names on each of the pages ? That would make it
more complex knowing which version of the control name to use to
populate (unless I can use dynamic names and tie the control name to
the page index or something like that). It would be nice to have
something like a control array across the pages ? Any way of doing
something like that or is there an easy way.

Jan 20 '06 #4
> Thanks. You wouldn't by any chance have a small example of doing
something like this would you ?


Marfi, there is enough done about that it would be easy to find, search for
usercontrol,

Is it not on Micks website?

There is so much on that pages about the tabpage.

Cor
Jan 20 '06 #5
Cor,

Yea, saw something similar. Curious about what you thought about my
last response where the pages would be hidden/shown when needed.

Not sure though how to address the controls in the code related to
which page the user is on and have a common set of code.

M

Jan 20 '06 #6
Marfi,
<>
Yea, saw something similar. Curious about what you thought about my
last response where the pages would be hidden/shown when needed.

Not sure though how to address the controls in the code related to
which page the user is on and have a common set of code.

The best sample for that is on the pages from Mick, that is why I know that
website. He has made a kind of total solution for that. (There is a bug in
1.x therefore you have to do something more).

Cor
Jan 20 '06 #7
Ok. Thanks for that site BTW. It's an excellent source for this.

Appreciate it.

Jan 20 '06 #8

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

Similar topics

4
13578
by: TMB333 | last post by:
I've researched as much as I can on the issue, but I've not found any clearly defined statement that acknowledges that the Hide method for a TabPage object just doesn't do what it's supposed to do. This appears to be a bug, or maybe I'm using it incorrectly? TabPage.Hide should hide the referenced TabPage object, should it not? Do I have to 'refresh' the Windows form somehow? The closest I've come to any means of hiding a TabPage from...
2
1688
by: JG | last post by:
Hi, I have a windows form with a TabControl on it. It has 3 tabpages on it. I have also coded a button that is supposed to 'add' a new tabpage. The code in that clicked event looks like this: tabPage tpNew = new TabPage("TabPage4"); this.tabControl1.TabPages.Add(tpNew); tpNew.Controls.Add(this.label1);
1
7652
by: RA | last post by:
Hi 1) I want to create a TabPage class in design mode - how do I do it? What type of project should I use? Is it going to be a custom control? 2) I have a TabControl that I would like to add to it the TabPage created in step 1. I don't want to draw the TabPage on the Tabcontrol in design mode, but to have a few TabPage controls that I candynamicaly load to the TabControl at runtime. Thanks
3
3485
by: Cynthia | last post by:
I knew that "Hide" doesn't work with Tabpage if I want to hide it. I should use Remove/Add. But I have some other controls in the tabpage which I don't want to use code to dynamiclly create them. If I use remove to remove that tabpage and later use add to add it back in, I have to write code to create all the controls inside that tabpage, otherwise it will be a blank page. What can I do to avoid it? Thank you for your time and help.
8
12069
by: touf | last post by:
Hi, I've a tabcontrol that contains many similar tabpages (exactly the same structure with different information), the tabpages number isn't known in the design time it depends of the data. Is there a way to clone ( copy the structure) a tabpage to create anew one by code? thanks.
4
10164
by: Ratan | last post by:
I have a form that has a tabcontrol with 5 tabpages. i want to rename the tabpages in runtime. Actually i want to right click the tabpage i want to rename and edit the text there itself. How to acheive it? Any help will be greatlty appreciated. /Ratan
2
7165
by: intrepid_dw | last post by:
All I am writing a C# WinForms application which is giving me some problems. The application consists of a form containing an empty Tab control to which TabPages are added dynamically (at runtime). Each TabPage contains a single Panel control. My intent is to draw a graph on that Panel control dynamically, with the code capturing a point at each update interval, then calling the Graphics.DrawLine method of the panel
6
4569
by: ray well | last post by:
i want a user to be able to change tab pages thru the keyboard, i tried entering the TabPage.text as '&1 Names', "&2 Addresses', etc., so that the user can change pages by type ALT 1, ALT 2, on the keyboard. but the text showing up in the tab is '&1 Names' instead of the '1' being underlined, and being able to be accessed thru the keyboard. how can i get a user to be able to change from TabPage to TabPage thru the keyboard? i find it...
6
12935
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello gurus, I want to have a Form with a TabControl, this TabControl will contain TabPage that has controls in it, this TabPage is prepared at design time. I want in runtime to duplicate the TabPage that wad made during the design time together with all its controls, but without the controls data. Is there an easy way to do that?
0
9518
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
10212
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...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
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
7538
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...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
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.