problem with tab controls, one inside another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I've got tab control called M. There are three pages X,Y and Z on M.
I want to put another tab control S on page Y of main tab control M.
When I do that (select tab control in tool box and click on Y) I get that another
'sub' tab control but it is visible also in X and Z pages of main tab control M.
(I switch between pages X,Y and Z and S is present on all of them!)
Can I make it visible only on page Y?
 
alekm said:
Hi,
I've got tab control called M. There are three pages X,Y and Z on M.
I want to put another tab control S on page Y of main tab control M.
When I do that (select tab control in tool box and click on Y) I get that another
'sub' tab control but it is visible also in X and Z pages of main tab control M.
(I switch between pages X,Y and Z and S is present on all of them!)
Can I make it visible only on page Y?

It is not possible to embed a TabControl on the Page of another TabControl.
You can get the same effect two ways.

1) Add a subform to a TabPage on the main TabControl and then add a
TabControl to the subform.

2) Position a second TabControl "in front of" the first TabControl and use
the Change event of the first TabControl to toggle the visible property of
the second TabControl such that it is only visible when a particular
TabPage of the first TabControl is activated.

The second method allows the "Sub-TabControl" to have data-bound controls
to the form's RecordSource which is problematic with a subform, but it is a
bit of a pain to work with in design view since the second TabControl is
always visible when in that view. This makes working on the other TabPages
difficult unless you temporarily move the second TabControl out of the way
and then put it back when finished.
 
Back
Top