how to inactive tabpage in tabcontrol?

teymoorei

Active member
Joined
Jan 11, 2012
Messages
36
Programming Experience
1-3
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.

Thank you for your advice

this way :

Thumbnail.png
 
There's nothing in the standard WinForms TabControl that will do that but you can create a custom control to do it. There are couple of custom controls here that do just that. They are very old so you would have to update to your preferred framework but the principle should still hold. There is also info about the TabControl in the Tips page on that site, but I don't think there's anything about disabling tabs there.
 
these components are old
Yes they are, which I already stated. Windows Forms hasn't changed much at all since they were created though, so you can use basically the same code in your own custom controls compiled for later Frameworks. The TabControl class probably hasn't changed at all since .NET Framework 2.0.
 
Back
Top