monami
monami

Reputation: 614

Is there a way to make a TabControl to be any of its tabs selected?

My client wants to have two separate tab lists on a form, but only one tab can be selected of the two tab lists. Can I create two TabControls to work like this? I.e. when one tab is selected at the first TabControl, the other should have all of their tabs deselected and vica versa.

EDIT:
This is what he imagined:enter image description here

Upvotes: 0

Views: 416

Answers (2)

tinstaafl
tinstaafl

Reputation: 6948

If I understand you correctly, you can put a tabcontrol(tabcontrol1) on a form. Add a tabpage for each set of pages you want to show.

On each tabpage, in tabcontrol1, add another tabcontrol and add however many pages you want in each.

To restrict access to a particular tab in tabcontrol1 set its enabled property to false;

Basically you'll end up with nested tabpages

Another option would be to create collections of tabpages that you could swap in and out of a single tabcontrol.

One way to get close to what you're pic shows is to use panels and put the tabcontrols inside them.

enter image description here

Upvotes: 0

topshot
topshot

Reputation: 885

Based on your image, I believe you should use RadioButtons. That limits selection to only 1 button but you can put them wherever you want. Then you could have a container that populates based on which button is selected.

enter image description here

Upvotes: 1

Related Questions