Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
I have two TabPages. I want the key of one of the tabs, for example TabPage2, to be disabled (the key on the top of the tab), not the elements inside the panel.

(turn off header tabpage)

Thank you for your advice

What I have tried:

I did not try any specific code
Posted
Updated 31-Oct-22 23:51pm
Comments
Graeme_Grant 31-Oct-22 6:41am    
Winforms, Wpf, Maui, Blazor, or Asp.net? Post what code you have tried please...
Member 15627495 1-Nov-22 4:39am    
in VB, it's usually : componant.enabled = true/false.

if your componant is part of a bigger container componants : COMPONANT.subcomponant.enabled = true/false

because there are few controls which are 'container' with childs componants.

1 solution

Each tab is a TabPage in a TabControl container and can bee accessed by its name, so if it called TabPage2 because you added but did not give it a proper name then in your code you can set the Enabled property;

TabPage2.Enabled = False

Or as an index of the TabControl TabPages;

tabcontrolname.TabPages(indexoftabpage).Enabled = False

Naming is better.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900