Duplicate controls on tab pages

S

stacy

I would like to create 4 tab pages in a tab control. 1 tab is for
properties, 1 is for status and 2 of the tabs will have the same
controls on them, for settings. The two settings tab pages will
contain identical Check boxes and Radio buttons within GroupBoxes. I
created the tab control with 3 tab pages using the toolbox (1 property
tab, 1 status tab and 1 settings tab). Then, at run time, I add the
forth tab page (if needed) and tried copying the controls from the
original tab page onto the new tab page:

For simplicity, I will only show the code for duplicating one control.
The control on the original settings page is gbRTO

Dim p2TabPg as New TabPage
Dim p2gb_RTO as New GroupBox

p2TabPg.Text = "Settings:pole2"
tabSensor.TabPages.Add(p2TabPg)

p2gb_RTO = gbRTO
tabSensor.TabPages(3).Controls.Add(p2gb_RTO)

When I run the code, the new control is placed on the new settings page
but the original control disappears from the original settings page.

Is there any way to do what I want without creating the forth tab
manually? If there isn't, is there a way to make the forth tab
invisible if it isn't needed?

Thanks,
Stacy
 
K

Ken Halter

stacy said:
I would like to create 4 tab pages in a tab control. 1 tab is for
properties, 1 is for status and 2 of the tabs will have the same
controls on them, for settings. The two settings tab pages will

No real help here... just a warning <g> Take care when doing things like
you're describing or your UI may end up here....

Interface Hall of Shame
- Tabbed Dialogs -
http://homepage.mac.com/bradster/iarchitect/tabs.htm
 
C

creator_bob

Can't you use a panel control and link it to another borderless form?
I think you could use the same borderless form for tab pages three and
four? (I'm at home without any references and don't even have VB.NET
on my home computer, but when I go to work, I can look at code where I
did this very thing)
 
C

creator_bob

I looked at how this was done. The thing I remember now is that the
form added to the panel's control must have the .toplevel property set
to false. For some reason, .toplevel doesn't show up in autocomplete.
 
S

stacy

Thanks for the tip, I'm a bit confused by what you mean when you say to
link a panel control to another borderless form? Do you mean that I
should lay a borderless form on the tab and the panel on top of the
form? Ultimately it would be great if I could create the old control
array type of design and put say
checkboxLED(0) on the third tab page and checkboxLED(1) on forth tab
page. The way if we ever have a product which needs 3 or 4...
different settings pages, the code is more easily expandable and
maintainable. Let me tell you also, that I am not a VB.net expert by
any means, I would say beginner/intermediate if I had to categorize
myself. My background is mostly in low level machine control and
driver development.

Stacy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top